

<!DOCTYPE html>
<html lang="zh-CN" data-default-color-scheme=auto>



<head>
  <meta charset="UTF-8">
  <link rel="apple-touch-icon" sizes="76x76" href="/img/favicon.png">
  <link rel="icon" href="/img/favicon.png">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5.0, shrink-to-fit=no">
  <meta http-equiv="x-ua-compatible" content="ie=edge">
  
  <meta name="theme-color" content="#2f4154">
  <meta name="author" content="John Doe">
  <meta name="keywords" content="">
  
    <meta name="description" content="版本12$ redis-server -vRedis server v&#x3D;5.0.8 sha&#x3D;00000000:0 malloc&#x3D;jemalloc-5.1.0 bits&#x3D;64 build&#x3D;d21bcca96e4afc9c  配置文件1234567891011121314151617181920212223242526272829303132333435363738394041424344454647">
<meta property="og:type" content="article">
<meta property="og:title" content="Redis配置文件详解">
<meta property="og:url" content="http://example.com/2020/05/11/redis/Redis%E9%85%8D%E7%BD%AE%E6%96%87%E4%BB%B6%E8%AF%A6%E8%A7%A3/index.html">
<meta property="og:site_name" content="Hexo">
<meta property="og:description" content="版本12$ redis-server -vRedis server v&#x3D;5.0.8 sha&#x3D;00000000:0 malloc&#x3D;jemalloc-5.1.0 bits&#x3D;64 build&#x3D;d21bcca96e4afc9c  配置文件1234567891011121314151617181920212223242526272829303132333435363738394041424344454647">
<meta property="og:locale" content="zh_CN">
<meta property="article:published_time" content="2020-05-11T07:01:52.000Z">
<meta property="article:modified_time" content="2020-05-25T18:39:22.000Z">
<meta property="article:author" content="John Doe">
<meta property="article:tag" content="Redis">
<meta name="twitter:card" content="summary_large_image">
  
  
  <title>Redis配置文件详解 - Hexo</title>

  <link  rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4/dist/css/bootstrap.min.css" />


  <link  rel="stylesheet" href="https://cdn.jsdelivr.net/npm/github-markdown-css@4/github-markdown.min.css" />
  <link  rel="stylesheet" href="https://cdn.jsdelivr.net/npm/hint.css@2/hint.min.css" />

  
    
    
      
      <link  rel="stylesheet" href="https://cdn.jsdelivr.net/npm/highlight.js@10/styles/github-gist.min.css" />
    
  

  
    <link  rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@3/dist/jquery.fancybox.min.css" />
  


<!-- 主题依赖的图标库，不要自行修改 -->

<link rel="stylesheet" href="//at.alicdn.com/t/font_1749284_ba1fz6golrf.css">



<link rel="stylesheet" href="//at.alicdn.com/t/font_1736178_lbnruvf0jn.css">


<link  rel="stylesheet" href="/css/main.css" />

<!-- 自定义样式保持在最底部 -->


  <script id="fluid-configs">
    var Fluid = window.Fluid || {};
    var CONFIG = {"hostname":"example.com","root":"/","version":"1.8.13","typing":{"enable":true,"typeSpeed":70,"cursorChar":"_","loop":false},"anchorjs":{"enable":true,"element":"h1,h2,h3,h4,h5,h6","placement":"right","visible":"hover","icon":""},"progressbar":{"enable":true,"height_px":3,"color":"#29d","options":{"showSpinner":false,"trickleSpeed":100}},"copy_btn":true,"image_zoom":{"enable":true,"img_url_replace":["",""]},"toc":{"enable":true,"headingSelector":"h1,h2,h3,h4,h5,h6","collapseDepth":0},"lazyload":{"enable":true,"loading_img":"/img/loading.gif","onlypost":false,"offset_factor":2},"web_analytics":{"enable":false,"baidu":null,"google":null,"gtag":null,"tencent":{"sid":null,"cid":null},"woyaola":null,"cnzz":null,"leancloud":{"app_id":null,"app_key":null,"server_url":null,"path":"window.location.pathname","ignore_local":false}},"search_path":"/local-search.xml"};
  </script>
  <script  src="/js/utils.js" ></script>
  <script  src="/js/color-schema.js" ></script>
<meta name="generator" content="Hexo 6.0.0"></head>


<body>
  <header style="height: 70vh;">
    <nav id="navbar" class="navbar fixed-top  navbar-expand-lg navbar-dark scrolling-navbar">
  <div class="container">
    <a class="navbar-brand" href="/">
      <strong>LZDF</strong>
    </a>

    <button id="navbar-toggler-btn" class="navbar-toggler" type="button" data-toggle="collapse"
            data-target="#navbarSupportedContent"
            aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
      <div class="animated-icon"><span></span><span></span><span></span></div>
    </button>

    <!-- Collapsible content -->
    <div class="collapse navbar-collapse" id="navbarSupportedContent">
      <ul class="navbar-nav ml-auto text-center">
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/">
                <i class="iconfont icon-home-fill"></i>
                首页
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/archives/">
                <i class="iconfont icon-archive-fill"></i>
                归档
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/categories/">
                <i class="iconfont icon-category-fill"></i>
                分类
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/tags/">
                <i class="iconfont icon-tags-fill"></i>
                标签
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/about/">
                <i class="iconfont icon-user-fill"></i>
                关于
              </a>
            </li>
          
        
        
          <li class="nav-item" id="search-btn">
            <a class="nav-link" target="_self" href="javascript:;" data-toggle="modal" data-target="#modalSearch" aria-label="Search">
              &nbsp;<i class="iconfont icon-search"></i>&nbsp;
            </a>
          </li>
        
        
          <li class="nav-item" id="color-toggle-btn">
            <a class="nav-link" target="_self" href="javascript:;" aria-label="Color Toggle">&nbsp;<i
                class="iconfont icon-dark" id="color-toggle-icon"></i>&nbsp;</a>
          </li>
        
      </ul>
    </div>
  </div>
</nav>

    <div class="banner" id="banner" parallax=true
         style="background: url('/img/default.png') no-repeat center center;
           background-size: cover;">
      <div class="full-bg-img">
        <div class="mask flex-center" style="background-color: rgba(0, 0, 0, 0.3)">
          <div class="page-header text-center fade-in-up">
            <span class="h2" id="subtitle" title="Redis配置文件详解">
              
            </span>

            
              <div class="mt-3">
  
  
    <span class="post-meta">
      <i class="iconfont icon-date-fill" aria-hidden="true"></i>
      <time datetime="2020-05-11 15:01" pubdate>
        2020年5月11日 下午
      </time>
    </span>
  
</div>

<div class="mt-1">
  
    <span class="post-meta mr-2">
      <i class="iconfont icon-chart"></i>
      68k 字
    </span>
  

  
    <span class="post-meta mr-2">
      <i class="iconfont icon-clock-fill"></i>
      
      
      568 分钟
    </span>
  

  
  
</div>

            
          </div>

          
        </div>
      </div>
    </div>
  </header>

  <main>
    
      

<div class="container-fluid nopadding-x">
  <div class="row nomargin-x">
    <div class="d-none d-lg-block col-lg-2"></div>
    <div class="col-lg-8 nopadding-x-md">
      <div class="container nopadding-x-md" id="board-ctn">
        <div class="py-5" id="board">
          <article class="post-content mx-auto">
            <!-- SEO header -->
            <h1 style="display: none">Redis配置文件详解</h1>
            
            <div class="markdown-body">
              <h1 id="版本"><a href="#版本" class="headerlink" title="版本"></a>版本</h1><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs bash">$ redis-server -v<br>Redis server v=5.0.8 sha=00000000:0 malloc=jemalloc-5.1.0 bits=64 build=d21bcca96e4afc9c<br></code></pre></td></tr></table></figure>

<h1 id="配置文件"><a href="#配置文件" class="headerlink" title="配置文件"></a>配置文件</h1><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br><span class="line">99</span><br><span class="line">100</span><br><span class="line">101</span><br><span class="line">102</span><br><span class="line">103</span><br><span class="line">104</span><br><span class="line">105</span><br><span class="line">106</span><br><span class="line">107</span><br><span class="line">108</span><br><span class="line">109</span><br><span class="line">110</span><br><span class="line">111</span><br><span class="line">112</span><br><span class="line">113</span><br><span class="line">114</span><br><span class="line">115</span><br><span class="line">116</span><br><span class="line">117</span><br><span class="line">118</span><br><span class="line">119</span><br><span class="line">120</span><br><span class="line">121</span><br><span class="line">122</span><br><span class="line">123</span><br><span class="line">124</span><br><span class="line">125</span><br><span class="line">126</span><br><span class="line">127</span><br><span class="line">128</span><br><span class="line">129</span><br><span class="line">130</span><br><span class="line">131</span><br><span class="line">132</span><br><span class="line">133</span><br><span class="line">134</span><br><span class="line">135</span><br><span class="line">136</span><br><span class="line">137</span><br><span class="line">138</span><br><span class="line">139</span><br><span class="line">140</span><br><span class="line">141</span><br><span class="line">142</span><br><span class="line">143</span><br><span class="line">144</span><br><span class="line">145</span><br><span class="line">146</span><br><span class="line">147</span><br><span class="line">148</span><br><span class="line">149</span><br><span class="line">150</span><br><span class="line">151</span><br><span class="line">152</span><br><span class="line">153</span><br><span class="line">154</span><br><span class="line">155</span><br><span class="line">156</span><br><span class="line">157</span><br><span class="line">158</span><br><span class="line">159</span><br><span class="line">160</span><br><span class="line">161</span><br><span class="line">162</span><br><span class="line">163</span><br><span class="line">164</span><br><span class="line">165</span><br><span class="line">166</span><br><span class="line">167</span><br><span class="line">168</span><br><span class="line">169</span><br><span class="line">170</span><br><span class="line">171</span><br><span class="line">172</span><br><span class="line">173</span><br><span class="line">174</span><br><span class="line">175</span><br><span class="line">176</span><br><span class="line">177</span><br><span class="line">178</span><br><span class="line">179</span><br><span class="line">180</span><br><span class="line">181</span><br><span class="line">182</span><br><span class="line">183</span><br><span class="line">184</span><br><span class="line">185</span><br><span class="line">186</span><br><span class="line">187</span><br><span class="line">188</span><br><span class="line">189</span><br><span class="line">190</span><br><span class="line">191</span><br><span class="line">192</span><br><span class="line">193</span><br><span class="line">194</span><br><span class="line">195</span><br><span class="line">196</span><br><span class="line">197</span><br><span class="line">198</span><br><span class="line">199</span><br><span class="line">200</span><br><span class="line">201</span><br><span class="line">202</span><br><span class="line">203</span><br><span class="line">204</span><br><span class="line">205</span><br><span class="line">206</span><br><span class="line">207</span><br><span class="line">208</span><br><span class="line">209</span><br><span class="line">210</span><br><span class="line">211</span><br><span class="line">212</span><br><span class="line">213</span><br><span class="line">214</span><br><span class="line">215</span><br><span class="line">216</span><br><span class="line">217</span><br><span class="line">218</span><br><span class="line">219</span><br><span class="line">220</span><br><span class="line">221</span><br><span class="line">222</span><br><span class="line">223</span><br><span class="line">224</span><br><span class="line">225</span><br><span class="line">226</span><br><span class="line">227</span><br><span class="line">228</span><br><span class="line">229</span><br><span class="line">230</span><br><span class="line">231</span><br><span class="line">232</span><br><span class="line">233</span><br><span class="line">234</span><br><span class="line">235</span><br><span class="line">236</span><br><span class="line">237</span><br><span class="line">238</span><br><span class="line">239</span><br><span class="line">240</span><br><span class="line">241</span><br><span class="line">242</span><br><span class="line">243</span><br><span class="line">244</span><br><span class="line">245</span><br><span class="line">246</span><br><span class="line">247</span><br><span class="line">248</span><br><span class="line">249</span><br><span class="line">250</span><br><span class="line">251</span><br><span class="line">252</span><br><span class="line">253</span><br><span class="line">254</span><br><span class="line">255</span><br><span class="line">256</span><br><span class="line">257</span><br><span class="line">258</span><br><span class="line">259</span><br><span class="line">260</span><br><span class="line">261</span><br><span class="line">262</span><br><span class="line">263</span><br><span class="line">264</span><br><span class="line">265</span><br><span class="line">266</span><br><span class="line">267</span><br><span class="line">268</span><br><span class="line">269</span><br><span class="line">270</span><br><span class="line">271</span><br><span class="line">272</span><br><span class="line">273</span><br><span class="line">274</span><br><span class="line">275</span><br><span class="line">276</span><br><span class="line">277</span><br><span class="line">278</span><br><span class="line">279</span><br><span class="line">280</span><br><span class="line">281</span><br><span class="line">282</span><br><span class="line">283</span><br><span class="line">284</span><br><span class="line">285</span><br><span class="line">286</span><br><span class="line">287</span><br><span class="line">288</span><br><span class="line">289</span><br><span class="line">290</span><br><span class="line">291</span><br><span class="line">292</span><br><span class="line">293</span><br><span class="line">294</span><br><span class="line">295</span><br><span class="line">296</span><br><span class="line">297</span><br><span class="line">298</span><br><span class="line">299</span><br><span class="line">300</span><br><span class="line">301</span><br><span class="line">302</span><br><span class="line">303</span><br><span class="line">304</span><br><span class="line">305</span><br><span class="line">306</span><br><span class="line">307</span><br><span class="line">308</span><br><span class="line">309</span><br><span class="line">310</span><br><span class="line">311</span><br><span class="line">312</span><br><span class="line">313</span><br><span class="line">314</span><br><span class="line">315</span><br><span class="line">316</span><br><span class="line">317</span><br><span class="line">318</span><br><span class="line">319</span><br><span class="line">320</span><br><span class="line">321</span><br><span class="line">322</span><br><span class="line">323</span><br><span class="line">324</span><br><span class="line">325</span><br><span class="line">326</span><br><span class="line">327</span><br><span class="line">328</span><br><span class="line">329</span><br><span class="line">330</span><br><span class="line">331</span><br><span class="line">332</span><br><span class="line">333</span><br><span class="line">334</span><br><span class="line">335</span><br><span class="line">336</span><br><span class="line">337</span><br><span class="line">338</span><br><span class="line">339</span><br><span class="line">340</span><br><span class="line">341</span><br><span class="line">342</span><br><span class="line">343</span><br><span class="line">344</span><br><span class="line">345</span><br><span class="line">346</span><br><span class="line">347</span><br><span class="line">348</span><br><span class="line">349</span><br><span class="line">350</span><br><span class="line">351</span><br><span class="line">352</span><br><span class="line">353</span><br><span class="line">354</span><br><span class="line">355</span><br><span class="line">356</span><br><span class="line">357</span><br><span class="line">358</span><br><span class="line">359</span><br><span class="line">360</span><br><span class="line">361</span><br><span class="line">362</span><br><span class="line">363</span><br><span class="line">364</span><br><span class="line">365</span><br><span class="line">366</span><br><span class="line">367</span><br><span class="line">368</span><br><span class="line">369</span><br><span class="line">370</span><br><span class="line">371</span><br><span class="line">372</span><br><span class="line">373</span><br><span class="line">374</span><br><span class="line">375</span><br><span class="line">376</span><br><span class="line">377</span><br><span class="line">378</span><br><span class="line">379</span><br><span class="line">380</span><br><span class="line">381</span><br><span class="line">382</span><br><span class="line">383</span><br><span class="line">384</span><br><span class="line">385</span><br><span class="line">386</span><br><span class="line">387</span><br><span class="line">388</span><br><span class="line">389</span><br><span class="line">390</span><br><span class="line">391</span><br><span class="line">392</span><br><span class="line">393</span><br><span class="line">394</span><br><span class="line">395</span><br><span class="line">396</span><br><span class="line">397</span><br><span class="line">398</span><br><span class="line">399</span><br><span class="line">400</span><br><span class="line">401</span><br><span class="line">402</span><br><span class="line">403</span><br><span class="line">404</span><br><span class="line">405</span><br><span class="line">406</span><br><span class="line">407</span><br><span class="line">408</span><br><span class="line">409</span><br><span class="line">410</span><br><span class="line">411</span><br><span class="line">412</span><br><span class="line">413</span><br><span class="line">414</span><br><span class="line">415</span><br><span class="line">416</span><br><span class="line">417</span><br><span class="line">418</span><br><span class="line">419</span><br><span class="line">420</span><br><span class="line">421</span><br><span class="line">422</span><br><span class="line">423</span><br><span class="line">424</span><br><span class="line">425</span><br><span class="line">426</span><br><span class="line">427</span><br><span class="line">428</span><br><span class="line">429</span><br><span class="line">430</span><br><span class="line">431</span><br><span class="line">432</span><br><span class="line">433</span><br><span class="line">434</span><br><span class="line">435</span><br><span class="line">436</span><br><span class="line">437</span><br><span class="line">438</span><br><span class="line">439</span><br><span class="line">440</span><br><span class="line">441</span><br><span class="line">442</span><br><span class="line">443</span><br><span class="line">444</span><br><span class="line">445</span><br><span class="line">446</span><br><span class="line">447</span><br><span class="line">448</span><br><span class="line">449</span><br><span class="line">450</span><br><span class="line">451</span><br><span class="line">452</span><br><span class="line">453</span><br><span class="line">454</span><br><span class="line">455</span><br><span class="line">456</span><br><span class="line">457</span><br><span class="line">458</span><br><span class="line">459</span><br><span class="line">460</span><br><span class="line">461</span><br><span class="line">462</span><br><span class="line">463</span><br><span class="line">464</span><br><span class="line">465</span><br><span class="line">466</span><br><span class="line">467</span><br><span class="line">468</span><br><span class="line">469</span><br><span class="line">470</span><br><span class="line">471</span><br><span class="line">472</span><br><span class="line">473</span><br><span class="line">474</span><br><span class="line">475</span><br><span class="line">476</span><br><span class="line">477</span><br><span class="line">478</span><br><span class="line">479</span><br><span class="line">480</span><br><span class="line">481</span><br><span class="line">482</span><br><span class="line">483</span><br><span class="line">484</span><br><span class="line">485</span><br><span class="line">486</span><br><span class="line">487</span><br><span class="line">488</span><br><span class="line">489</span><br><span class="line">490</span><br><span class="line">491</span><br><span class="line">492</span><br><span class="line">493</span><br><span class="line">494</span><br><span class="line">495</span><br><span class="line">496</span><br><span class="line">497</span><br><span class="line">498</span><br><span class="line">499</span><br><span class="line">500</span><br><span class="line">501</span><br><span class="line">502</span><br><span class="line">503</span><br><span class="line">504</span><br><span class="line">505</span><br><span class="line">506</span><br><span class="line">507</span><br><span class="line">508</span><br><span class="line">509</span><br><span class="line">510</span><br><span class="line">511</span><br><span class="line">512</span><br><span class="line">513</span><br><span class="line">514</span><br><span class="line">515</span><br><span class="line">516</span><br><span class="line">517</span><br><span class="line">518</span><br><span class="line">519</span><br><span class="line">520</span><br><span class="line">521</span><br><span class="line">522</span><br><span class="line">523</span><br><span class="line">524</span><br><span class="line">525</span><br><span class="line">526</span><br><span class="line">527</span><br><span class="line">528</span><br><span class="line">529</span><br><span class="line">530</span><br><span class="line">531</span><br><span class="line">532</span><br><span class="line">533</span><br><span class="line">534</span><br><span class="line">535</span><br><span class="line">536</span><br><span class="line">537</span><br><span class="line">538</span><br><span class="line">539</span><br><span class="line">540</span><br><span class="line">541</span><br><span class="line">542</span><br><span class="line">543</span><br><span class="line">544</span><br><span class="line">545</span><br><span class="line">546</span><br><span class="line">547</span><br><span class="line">548</span><br><span class="line">549</span><br><span class="line">550</span><br><span class="line">551</span><br><span class="line">552</span><br><span class="line">553</span><br><span class="line">554</span><br><span class="line">555</span><br><span class="line">556</span><br><span class="line">557</span><br><span class="line">558</span><br><span class="line">559</span><br><span class="line">560</span><br><span class="line">561</span><br><span class="line">562</span><br><span class="line">563</span><br><span class="line">564</span><br><span class="line">565</span><br><span class="line">566</span><br><span class="line">567</span><br><span class="line">568</span><br><span class="line">569</span><br><span class="line">570</span><br><span class="line">571</span><br><span class="line">572</span><br><span class="line">573</span><br><span class="line">574</span><br><span class="line">575</span><br><span class="line">576</span><br><span class="line">577</span><br><span class="line">578</span><br><span class="line">579</span><br><span class="line">580</span><br><span class="line">581</span><br><span class="line">582</span><br><span class="line">583</span><br><span class="line">584</span><br><span class="line">585</span><br><span class="line">586</span><br><span class="line">587</span><br><span class="line">588</span><br><span class="line">589</span><br><span class="line">590</span><br><span class="line">591</span><br><span class="line">592</span><br><span class="line">593</span><br><span class="line">594</span><br><span class="line">595</span><br><span class="line">596</span><br><span class="line">597</span><br><span class="line">598</span><br><span class="line">599</span><br><span class="line">600</span><br><span class="line">601</span><br><span class="line">602</span><br><span class="line">603</span><br><span class="line">604</span><br><span class="line">605</span><br><span class="line">606</span><br><span class="line">607</span><br><span class="line">608</span><br><span class="line">609</span><br><span class="line">610</span><br><span class="line">611</span><br><span class="line">612</span><br><span class="line">613</span><br><span class="line">614</span><br><span class="line">615</span><br><span class="line">616</span><br><span class="line">617</span><br><span class="line">618</span><br><span class="line">619</span><br><span class="line">620</span><br><span class="line">621</span><br><span class="line">622</span><br><span class="line">623</span><br><span class="line">624</span><br><span class="line">625</span><br><span class="line">626</span><br><span class="line">627</span><br><span class="line">628</span><br><span class="line">629</span><br><span class="line">630</span><br><span class="line">631</span><br><span class="line">632</span><br><span class="line">633</span><br><span class="line">634</span><br><span class="line">635</span><br><span class="line">636</span><br><span class="line">637</span><br><span class="line">638</span><br><span class="line">639</span><br><span class="line">640</span><br><span class="line">641</span><br><span class="line">642</span><br><span class="line">643</span><br><span class="line">644</span><br><span class="line">645</span><br><span class="line">646</span><br><span class="line">647</span><br><span class="line">648</span><br><span class="line">649</span><br><span class="line">650</span><br><span class="line">651</span><br><span class="line">652</span><br><span class="line">653</span><br><span class="line">654</span><br><span class="line">655</span><br><span class="line">656</span><br><span class="line">657</span><br><span class="line">658</span><br><span class="line">659</span><br><span class="line">660</span><br><span class="line">661</span><br><span class="line">662</span><br><span class="line">663</span><br><span class="line">664</span><br><span class="line">665</span><br><span class="line">666</span><br><span class="line">667</span><br><span class="line">668</span><br><span class="line">669</span><br><span class="line">670</span><br><span class="line">671</span><br><span class="line">672</span><br><span class="line">673</span><br><span class="line">674</span><br><span class="line">675</span><br><span class="line">676</span><br><span class="line">677</span><br><span class="line">678</span><br><span class="line">679</span><br><span class="line">680</span><br><span class="line">681</span><br><span class="line">682</span><br><span class="line">683</span><br><span class="line">684</span><br><span class="line">685</span><br><span class="line">686</span><br><span class="line">687</span><br><span class="line">688</span><br><span class="line">689</span><br><span class="line">690</span><br><span class="line">691</span><br><span class="line">692</span><br><span class="line">693</span><br><span class="line">694</span><br><span class="line">695</span><br><span class="line">696</span><br><span class="line">697</span><br><span class="line">698</span><br><span class="line">699</span><br><span class="line">700</span><br><span class="line">701</span><br><span class="line">702</span><br><span class="line">703</span><br><span class="line">704</span><br><span class="line">705</span><br><span class="line">706</span><br><span class="line">707</span><br><span class="line">708</span><br><span class="line">709</span><br><span class="line">710</span><br><span class="line">711</span><br><span class="line">712</span><br><span class="line">713</span><br><span class="line">714</span><br><span class="line">715</span><br><span class="line">716</span><br><span class="line">717</span><br><span class="line">718</span><br><span class="line">719</span><br><span class="line">720</span><br><span class="line">721</span><br><span class="line">722</span><br><span class="line">723</span><br><span class="line">724</span><br><span class="line">725</span><br><span class="line">726</span><br><span class="line">727</span><br><span class="line">728</span><br><span class="line">729</span><br><span class="line">730</span><br><span class="line">731</span><br><span class="line">732</span><br><span class="line">733</span><br><span class="line">734</span><br><span class="line">735</span><br><span class="line">736</span><br><span class="line">737</span><br><span class="line">738</span><br><span class="line">739</span><br><span class="line">740</span><br><span class="line">741</span><br><span class="line">742</span><br><span class="line">743</span><br><span class="line">744</span><br><span class="line">745</span><br><span class="line">746</span><br><span class="line">747</span><br><span class="line">748</span><br><span class="line">749</span><br><span class="line">750</span><br><span class="line">751</span><br><span class="line">752</span><br><span class="line">753</span><br><span class="line">754</span><br><span class="line">755</span><br><span class="line">756</span><br><span class="line">757</span><br><span class="line">758</span><br><span class="line">759</span><br><span class="line">760</span><br><span class="line">761</span><br><span class="line">762</span><br><span class="line">763</span><br><span class="line">764</span><br><span class="line">765</span><br><span class="line">766</span><br><span class="line">767</span><br><span class="line">768</span><br><span class="line">769</span><br><span class="line">770</span><br><span class="line">771</span><br><span class="line">772</span><br><span class="line">773</span><br><span class="line">774</span><br><span class="line">775</span><br><span class="line">776</span><br><span class="line">777</span><br><span class="line">778</span><br><span class="line">779</span><br><span class="line">780</span><br><span class="line">781</span><br><span class="line">782</span><br><span class="line">783</span><br><span class="line">784</span><br><span class="line">785</span><br><span class="line">786</span><br><span class="line">787</span><br><span class="line">788</span><br><span class="line">789</span><br><span class="line">790</span><br><span class="line">791</span><br><span class="line">792</span><br><span class="line">793</span><br><span class="line">794</span><br><span class="line">795</span><br><span class="line">796</span><br><span class="line">797</span><br><span class="line">798</span><br><span class="line">799</span><br><span class="line">800</span><br><span class="line">801</span><br><span class="line">802</span><br><span class="line">803</span><br><span class="line">804</span><br><span class="line">805</span><br><span class="line">806</span><br><span class="line">807</span><br><span class="line">808</span><br><span class="line">809</span><br><span class="line">810</span><br><span class="line">811</span><br><span class="line">812</span><br><span class="line">813</span><br><span class="line">814</span><br><span class="line">815</span><br><span class="line">816</span><br><span class="line">817</span><br><span class="line">818</span><br><span class="line">819</span><br><span class="line">820</span><br><span class="line">821</span><br><span class="line">822</span><br><span class="line">823</span><br><span class="line">824</span><br><span class="line">825</span><br><span class="line">826</span><br><span class="line">827</span><br><span class="line">828</span><br><span class="line">829</span><br><span class="line">830</span><br><span class="line">831</span><br><span class="line">832</span><br><span class="line">833</span><br><span class="line">834</span><br><span class="line">835</span><br><span class="line">836</span><br><span class="line">837</span><br><span class="line">838</span><br><span class="line">839</span><br><span class="line">840</span><br><span class="line">841</span><br><span class="line">842</span><br><span class="line">843</span><br><span class="line">844</span><br><span class="line">845</span><br><span class="line">846</span><br><span class="line">847</span><br><span class="line">848</span><br><span class="line">849</span><br><span class="line">850</span><br><span class="line">851</span><br><span class="line">852</span><br><span class="line">853</span><br><span class="line">854</span><br><span class="line">855</span><br><span class="line">856</span><br><span class="line">857</span><br><span class="line">858</span><br><span class="line">859</span><br><span class="line">860</span><br><span class="line">861</span><br><span class="line">862</span><br><span class="line">863</span><br><span class="line">864</span><br><span class="line">865</span><br><span class="line">866</span><br><span class="line">867</span><br><span class="line">868</span><br><span class="line">869</span><br><span class="line">870</span><br><span class="line">871</span><br><span class="line">872</span><br><span class="line">873</span><br><span class="line">874</span><br><span class="line">875</span><br><span class="line">876</span><br><span class="line">877</span><br><span class="line">878</span><br><span class="line">879</span><br><span class="line">880</span><br><span class="line">881</span><br><span class="line">882</span><br><span class="line">883</span><br><span class="line">884</span><br><span class="line">885</span><br><span class="line">886</span><br><span class="line">887</span><br><span class="line">888</span><br><span class="line">889</span><br><span class="line">890</span><br><span class="line">891</span><br><span class="line">892</span><br><span class="line">893</span><br><span class="line">894</span><br><span class="line">895</span><br><span class="line">896</span><br><span class="line">897</span><br><span class="line">898</span><br><span class="line">899</span><br><span class="line">900</span><br><span class="line">901</span><br><span class="line">902</span><br><span class="line">903</span><br><span class="line">904</span><br><span class="line">905</span><br><span class="line">906</span><br><span class="line">907</span><br><span class="line">908</span><br><span class="line">909</span><br><span class="line">910</span><br><span class="line">911</span><br><span class="line">912</span><br><span class="line">913</span><br><span class="line">914</span><br><span class="line">915</span><br><span class="line">916</span><br><span class="line">917</span><br><span class="line">918</span><br><span class="line">919</span><br><span class="line">920</span><br><span class="line">921</span><br><span class="line">922</span><br><span class="line">923</span><br><span class="line">924</span><br><span class="line">925</span><br><span class="line">926</span><br><span class="line">927</span><br><span class="line">928</span><br><span class="line">929</span><br><span class="line">930</span><br><span class="line">931</span><br><span class="line">932</span><br><span class="line">933</span><br><span class="line">934</span><br><span class="line">935</span><br><span class="line">936</span><br><span class="line">937</span><br><span class="line">938</span><br><span class="line">939</span><br><span class="line">940</span><br><span class="line">941</span><br><span class="line">942</span><br><span class="line">943</span><br><span class="line">944</span><br><span class="line">945</span><br><span class="line">946</span><br><span class="line">947</span><br><span class="line">948</span><br><span class="line">949</span><br><span class="line">950</span><br><span class="line">951</span><br><span class="line">952</span><br><span class="line">953</span><br><span class="line">954</span><br><span class="line">955</span><br><span class="line">956</span><br><span class="line">957</span><br><span class="line">958</span><br><span class="line">959</span><br><span class="line">960</span><br><span class="line">961</span><br><span class="line">962</span><br><span class="line">963</span><br><span class="line">964</span><br><span class="line">965</span><br><span class="line">966</span><br><span class="line">967</span><br><span class="line">968</span><br><span class="line">969</span><br><span class="line">970</span><br><span class="line">971</span><br><span class="line">972</span><br><span class="line">973</span><br><span class="line">974</span><br><span class="line">975</span><br><span class="line">976</span><br><span class="line">977</span><br><span class="line">978</span><br><span class="line">979</span><br><span class="line">980</span><br><span class="line">981</span><br><span class="line">982</span><br><span class="line">983</span><br><span class="line">984</span><br><span class="line">985</span><br><span class="line">986</span><br><span class="line">987</span><br><span class="line">988</span><br><span class="line">989</span><br><span class="line">990</span><br><span class="line">991</span><br><span class="line">992</span><br><span class="line">993</span><br><span class="line">994</span><br><span class="line">995</span><br><span class="line">996</span><br><span class="line">997</span><br><span class="line">998</span><br><span class="line">999</span><br><span class="line">1000</span><br><span class="line">1001</span><br><span class="line">1002</span><br><span class="line">1003</span><br><span class="line">1004</span><br><span class="line">1005</span><br><span class="line">1006</span><br><span class="line">1007</span><br><span class="line">1008</span><br><span class="line">1009</span><br><span class="line">1010</span><br><span class="line">1011</span><br><span class="line">1012</span><br><span class="line">1013</span><br><span class="line">1014</span><br><span class="line">1015</span><br><span class="line">1016</span><br><span class="line">1017</span><br><span class="line">1018</span><br><span class="line">1019</span><br><span class="line">1020</span><br><span class="line">1021</span><br><span class="line">1022</span><br><span class="line">1023</span><br><span class="line">1024</span><br><span class="line">1025</span><br><span class="line">1026</span><br><span class="line">1027</span><br><span class="line">1028</span><br><span class="line">1029</span><br><span class="line">1030</span><br><span class="line">1031</span><br><span class="line">1032</span><br><span class="line">1033</span><br><span class="line">1034</span><br><span class="line">1035</span><br><span class="line">1036</span><br><span class="line">1037</span><br><span class="line">1038</span><br><span class="line">1039</span><br><span class="line">1040</span><br><span class="line">1041</span><br><span class="line">1042</span><br><span class="line">1043</span><br><span class="line">1044</span><br><span class="line">1045</span><br><span class="line">1046</span><br><span class="line">1047</span><br><span class="line">1048</span><br><span class="line">1049</span><br><span class="line">1050</span><br><span class="line">1051</span><br><span class="line">1052</span><br><span class="line">1053</span><br><span class="line">1054</span><br><span class="line">1055</span><br><span class="line">1056</span><br><span class="line">1057</span><br><span class="line">1058</span><br><span class="line">1059</span><br><span class="line">1060</span><br><span class="line">1061</span><br><span class="line">1062</span><br><span class="line">1063</span><br><span class="line">1064</span><br><span class="line">1065</span><br><span class="line">1066</span><br><span class="line">1067</span><br><span class="line">1068</span><br><span class="line">1069</span><br><span class="line">1070</span><br><span class="line">1071</span><br><span class="line">1072</span><br><span class="line">1073</span><br><span class="line">1074</span><br><span class="line">1075</span><br><span class="line">1076</span><br><span class="line">1077</span><br><span class="line">1078</span><br><span class="line">1079</span><br><span class="line">1080</span><br><span class="line">1081</span><br><span class="line">1082</span><br><span class="line">1083</span><br><span class="line">1084</span><br><span class="line">1085</span><br><span class="line">1086</span><br><span class="line">1087</span><br><span class="line">1088</span><br><span class="line">1089</span><br><span class="line">1090</span><br><span class="line">1091</span><br><span class="line">1092</span><br><span class="line">1093</span><br><span class="line">1094</span><br><span class="line">1095</span><br><span class="line">1096</span><br><span class="line">1097</span><br><span class="line">1098</span><br><span class="line">1099</span><br><span class="line">1100</span><br><span class="line">1101</span><br><span class="line">1102</span><br><span class="line">1103</span><br><span class="line">1104</span><br><span class="line">1105</span><br><span class="line">1106</span><br><span class="line">1107</span><br><span class="line">1108</span><br><span class="line">1109</span><br><span class="line">1110</span><br><span class="line">1111</span><br><span class="line">1112</span><br><span class="line">1113</span><br><span class="line">1114</span><br><span class="line">1115</span><br><span class="line">1116</span><br><span class="line">1117</span><br><span class="line">1118</span><br><span class="line">1119</span><br><span class="line">1120</span><br><span class="line">1121</span><br><span class="line">1122</span><br><span class="line">1123</span><br><span class="line">1124</span><br><span class="line">1125</span><br><span class="line">1126</span><br><span class="line">1127</span><br><span class="line">1128</span><br><span class="line">1129</span><br><span class="line">1130</span><br><span class="line">1131</span><br><span class="line">1132</span><br><span class="line">1133</span><br><span class="line">1134</span><br><span class="line">1135</span><br><span class="line">1136</span><br><span class="line">1137</span><br><span class="line">1138</span><br><span class="line">1139</span><br><span class="line">1140</span><br><span class="line">1141</span><br><span class="line">1142</span><br><span class="line">1143</span><br><span class="line">1144</span><br><span class="line">1145</span><br><span class="line">1146</span><br><span class="line">1147</span><br><span class="line">1148</span><br><span class="line">1149</span><br><span class="line">1150</span><br><span class="line">1151</span><br><span class="line">1152</span><br><span class="line">1153</span><br><span class="line">1154</span><br><span class="line">1155</span><br><span class="line">1156</span><br><span class="line">1157</span><br><span class="line">1158</span><br><span class="line">1159</span><br><span class="line">1160</span><br><span class="line">1161</span><br><span class="line">1162</span><br><span class="line">1163</span><br><span class="line">1164</span><br><span class="line">1165</span><br><span class="line">1166</span><br><span class="line">1167</span><br><span class="line">1168</span><br><span class="line">1169</span><br><span class="line">1170</span><br><span class="line">1171</span><br><span class="line">1172</span><br><span class="line">1173</span><br><span class="line">1174</span><br><span class="line">1175</span><br><span class="line">1176</span><br><span class="line">1177</span><br><span class="line">1178</span><br><span class="line">1179</span><br><span class="line">1180</span><br><span class="line">1181</span><br><span class="line">1182</span><br><span class="line">1183</span><br><span class="line">1184</span><br><span class="line">1185</span><br><span class="line">1186</span><br><span class="line">1187</span><br><span class="line">1188</span><br><span class="line">1189</span><br><span class="line">1190</span><br><span class="line">1191</span><br><span class="line">1192</span><br><span class="line">1193</span><br><span class="line">1194</span><br><span class="line">1195</span><br><span class="line">1196</span><br><span class="line">1197</span><br><span class="line">1198</span><br><span class="line">1199</span><br><span class="line">1200</span><br><span class="line">1201</span><br><span class="line">1202</span><br><span class="line">1203</span><br><span class="line">1204</span><br><span class="line">1205</span><br><span class="line">1206</span><br><span class="line">1207</span><br><span class="line">1208</span><br><span class="line">1209</span><br><span class="line">1210</span><br><span class="line">1211</span><br><span class="line">1212</span><br><span class="line">1213</span><br><span class="line">1214</span><br><span class="line">1215</span><br><span class="line">1216</span><br><span class="line">1217</span><br><span class="line">1218</span><br><span class="line">1219</span><br><span class="line">1220</span><br><span class="line">1221</span><br><span class="line">1222</span><br><span class="line">1223</span><br><span class="line">1224</span><br><span class="line">1225</span><br><span class="line">1226</span><br><span class="line">1227</span><br><span class="line">1228</span><br><span class="line">1229</span><br><span class="line">1230</span><br><span class="line">1231</span><br><span class="line">1232</span><br><span class="line">1233</span><br><span class="line">1234</span><br><span class="line">1235</span><br><span class="line">1236</span><br><span class="line">1237</span><br><span class="line">1238</span><br><span class="line">1239</span><br><span class="line">1240</span><br><span class="line">1241</span><br><span class="line">1242</span><br><span class="line">1243</span><br><span class="line">1244</span><br><span class="line">1245</span><br><span class="line">1246</span><br><span class="line">1247</span><br><span class="line">1248</span><br><span class="line">1249</span><br><span class="line">1250</span><br><span class="line">1251</span><br><span class="line">1252</span><br><span class="line">1253</span><br><span class="line">1254</span><br><span class="line">1255</span><br><span class="line">1256</span><br><span class="line">1257</span><br><span class="line">1258</span><br><span class="line">1259</span><br><span class="line">1260</span><br><span class="line">1261</span><br><span class="line">1262</span><br><span class="line">1263</span><br><span class="line">1264</span><br><span class="line">1265</span><br><span class="line">1266</span><br><span class="line">1267</span><br><span class="line">1268</span><br><span class="line">1269</span><br><span class="line">1270</span><br><span class="line">1271</span><br><span class="line">1272</span><br><span class="line">1273</span><br><span class="line">1274</span><br><span class="line">1275</span><br><span class="line">1276</span><br><span class="line">1277</span><br><span class="line">1278</span><br><span class="line">1279</span><br><span class="line">1280</span><br><span class="line">1281</span><br><span class="line">1282</span><br><span class="line">1283</span><br><span class="line">1284</span><br><span class="line">1285</span><br><span class="line">1286</span><br><span class="line">1287</span><br><span class="line">1288</span><br><span class="line">1289</span><br><span class="line">1290</span><br><span class="line">1291</span><br><span class="line">1292</span><br><span class="line">1293</span><br><span class="line">1294</span><br><span class="line">1295</span><br><span class="line">1296</span><br><span class="line">1297</span><br><span class="line">1298</span><br><span class="line">1299</span><br><span class="line">1300</span><br><span class="line">1301</span><br><span class="line">1302</span><br><span class="line">1303</span><br><span class="line">1304</span><br><span class="line">1305</span><br><span class="line">1306</span><br><span class="line">1307</span><br><span class="line">1308</span><br><span class="line">1309</span><br><span class="line">1310</span><br><span class="line">1311</span><br><span class="line">1312</span><br><span class="line">1313</span><br><span class="line">1314</span><br><span class="line">1315</span><br><span class="line">1316</span><br><span class="line">1317</span><br><span class="line">1318</span><br><span class="line">1319</span><br><span class="line">1320</span><br><span class="line">1321</span><br><span class="line">1322</span><br><span class="line">1323</span><br><span class="line">1324</span><br><span class="line">1325</span><br><span class="line">1326</span><br><span class="line">1327</span><br><span class="line">1328</span><br><span class="line">1329</span><br><span class="line">1330</span><br><span class="line">1331</span><br><span class="line">1332</span><br><span class="line">1333</span><br><span class="line">1334</span><br><span class="line">1335</span><br><span class="line">1336</span><br><span class="line">1337</span><br><span class="line">1338</span><br><span class="line">1339</span><br><span class="line">1340</span><br><span class="line">1341</span><br><span class="line">1342</span><br><span class="line">1343</span><br><span class="line">1344</span><br><span class="line">1345</span><br><span class="line">1346</span><br><span class="line">1347</span><br><span class="line">1348</span><br><span class="line">1349</span><br><span class="line">1350</span><br><span class="line">1351</span><br><span class="line">1352</span><br><span class="line">1353</span><br><span class="line">1354</span><br><span class="line">1355</span><br><span class="line">1356</span><br><span class="line">1357</span><br><span class="line">1358</span><br><span class="line">1359</span><br><span class="line">1360</span><br><span class="line">1361</span><br><span class="line">1362</span><br><span class="line">1363</span><br><span class="line">1364</span><br><span class="line">1365</span><br><span class="line">1366</span><br><span class="line">1367</span><br><span class="line">1368</span><br><span class="line">1369</span><br><span class="line">1370</span><br><span class="line">1371</span><br><span class="line">1372</span><br><span class="line">1373</span><br><span class="line">1374</span><br><span class="line">1375</span><br><span class="line">1376</span><br><span class="line">1377</span><br><span class="line">1378</span><br><span class="line">1379</span><br><span class="line">1380</span><br><span class="line">1381</span><br><span class="line">1382</span><br><span class="line">1383</span><br><span class="line">1384</span><br><span class="line">1385</span><br><span class="line">1386</span><br><span class="line">1387</span><br><span class="line">1388</span><br><span class="line">1389</span><br><span class="line">1390</span><br><span class="line">1391</span><br><span class="line">1392</span><br><span class="line">1393</span><br><span class="line">1394</span><br><span class="line">1395</span><br><span class="line">1396</span><br><span class="line">1397</span><br><span class="line">1398</span><br><span class="line">1399</span><br><span class="line">1400</span><br><span class="line">1401</span><br><span class="line">1402</span><br><span class="line">1403</span><br><span class="line">1404</span><br><span class="line">1405</span><br><span class="line">1406</span><br><span class="line">1407</span><br><span class="line">1408</span><br><span class="line">1409</span><br><span class="line">1410</span><br><span class="line">1411</span><br><span class="line">1412</span><br><span class="line">1413</span><br><span class="line">1414</span><br><span class="line">1415</span><br><span class="line">1416</span><br><span class="line">1417</span><br><span class="line">1418</span><br><span class="line">1419</span><br><span class="line">1420</span><br><span class="line">1421</span><br><span class="line">1422</span><br><span class="line">1423</span><br><span class="line">1424</span><br><span class="line">1425</span><br><span class="line">1426</span><br><span class="line">1427</span><br><span class="line">1428</span><br><span class="line">1429</span><br><span class="line">1430</span><br><span class="line">1431</span><br><span class="line">1432</span><br><span class="line">1433</span><br><span class="line">1434</span><br><span class="line">1435</span><br><span class="line">1436</span><br><span class="line">1437</span><br><span class="line">1438</span><br><span class="line">1439</span><br><span class="line">1440</span><br><span class="line">1441</span><br><span class="line">1442</span><br><span class="line">1443</span><br><span class="line">1444</span><br><span class="line">1445</span><br><span class="line">1446</span><br><span class="line">1447</span><br><span class="line">1448</span><br><span class="line">1449</span><br><span class="line">1450</span><br><span class="line">1451</span><br><span class="line">1452</span><br><span class="line">1453</span><br><span class="line">1454</span><br><span class="line">1455</span><br><span class="line">1456</span><br><span class="line">1457</span><br><span class="line">1458</span><br><span class="line">1459</span><br><span class="line">1460</span><br><span class="line">1461</span><br><span class="line">1462</span><br><span class="line">1463</span><br><span class="line">1464</span><br><span class="line">1465</span><br><span class="line">1466</span><br><span class="line">1467</span><br><span class="line">1468</span><br><span class="line">1469</span><br><span class="line">1470</span><br><span class="line">1471</span><br><span class="line">1472</span><br><span class="line">1473</span><br><span class="line">1474</span><br><span class="line">1475</span><br><span class="line">1476</span><br><span class="line">1477</span><br><span class="line">1478</span><br><span class="line">1479</span><br><span class="line">1480</span><br><span class="line">1481</span><br><span class="line">1482</span><br><span class="line">1483</span><br><span class="line">1484</span><br><span class="line">1485</span><br><span class="line">1486</span><br><span class="line">1487</span><br><span class="line">1488</span><br><span class="line">1489</span><br><span class="line">1490</span><br><span class="line">1491</span><br><span class="line">1492</span><br><span class="line">1493</span><br><span class="line">1494</span><br><span class="line">1495</span><br><span class="line">1496</span><br><span class="line">1497</span><br><span class="line">1498</span><br><span class="line">1499</span><br><span class="line">1500</span><br><span class="line">1501</span><br><span class="line">1502</span><br><span class="line">1503</span><br><span class="line">1504</span><br><span class="line">1505</span><br><span class="line">1506</span><br><span class="line">1507</span><br><span class="line">1508</span><br><span class="line">1509</span><br><span class="line">1510</span><br><span class="line">1511</span><br><span class="line">1512</span><br><span class="line">1513</span><br><span class="line">1514</span><br><span class="line">1515</span><br><span class="line">1516</span><br><span class="line">1517</span><br><span class="line">1518</span><br><span class="line">1519</span><br><span class="line">1520</span><br><span class="line">1521</span><br><span class="line">1522</span><br><span class="line">1523</span><br><span class="line">1524</span><br><span class="line">1525</span><br><span class="line">1526</span><br><span class="line">1527</span><br><span class="line">1528</span><br><span class="line">1529</span><br><span class="line">1530</span><br><span class="line">1531</span><br><span class="line">1532</span><br><span class="line">1533</span><br><span class="line">1534</span><br><span class="line">1535</span><br><span class="line">1536</span><br><span class="line">1537</span><br><span class="line">1538</span><br><span class="line">1539</span><br><span class="line">1540</span><br><span class="line">1541</span><br><span class="line">1542</span><br><span class="line">1543</span><br><span class="line">1544</span><br><span class="line">1545</span><br><span class="line">1546</span><br><span class="line">1547</span><br><span class="line">1548</span><br><span class="line">1549</span><br><span class="line">1550</span><br><span class="line">1551</span><br><span class="line">1552</span><br><span class="line">1553</span><br><span class="line">1554</span><br><span class="line">1555</span><br><span class="line">1556</span><br><span class="line">1557</span><br><span class="line">1558</span><br><span class="line">1559</span><br><span class="line">1560</span><br><span class="line">1561</span><br><span class="line">1562</span><br><span class="line">1563</span><br><span class="line">1564</span><br><span class="line">1565</span><br><span class="line">1566</span><br><span class="line">1567</span><br><span class="line">1568</span><br><span class="line">1569</span><br><span class="line">1570</span><br><span class="line">1571</span><br><span class="line">1572</span><br><span class="line">1573</span><br><span class="line">1574</span><br><span class="line">1575</span><br></pre></td><td class="code"><pre><code class="hljs bash"><span class="hljs-comment"># Redis配置文件示例。</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># 加载配置文件：</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># ./redis-server /path/to/redis.conf</span><br><br><span class="hljs-comment"># Note on units: when memory size is needed, it is possible to specify</span><br><span class="hljs-comment"># it in the usual form of 1k 5GB 4M and so forth:3333</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># 1k =&gt; 1000 bytes</span><br><span class="hljs-comment"># 1kb =&gt; 1024 bytes</span><br><span class="hljs-comment"># 1m =&gt; 1000000 bytes</span><br><span class="hljs-comment"># 1mb =&gt; 1024*1024 bytes</span><br><span class="hljs-comment"># 1g =&gt; 1000000000 bytes</span><br><span class="hljs-comment"># 1gb =&gt; 1024*1024*1024 bytes</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># units are case insensitive so 1GB 1Gb 1gB are all the same.</span><br><br><span class="hljs-comment">################################## 包含其他配置文件 ###################################</span><br><br><span class="hljs-comment"># 如果你想在所有 Redis 服务器上，在公共配置文件之后加载其他的少量配置，可以 使用 include 来加载特殊的配置。</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># 注意，管员和 Redis 前哨不能通过命令 “CONFIG REWRITE” 重写 include 加载的配置文件。</span><br><span class="hljs-comment"># 因为 Redsi 始终使用最后一行作为配置的执行，所以为了不影响原有的配置信息，最好件开头使用 </span><br><span class="hljs-comment"># include 加载配置文件。</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># 相反如果你想用 include 加载的配置文件覆盖配置，因该在最后一行使用 include。</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># include /path/to/local.conf</span><br><span class="hljs-comment"># include /path/to/other.conf</span><br><br><span class="hljs-comment">################################## 模块 #####################################</span><br><br><span class="hljs-comment"># Load modules at startup. If the server is not able to load modules</span><br><span class="hljs-comment"># it will abort. It is possible to use multiple loadmodule directives.</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># loadmodule /path/to/my_module.so</span><br><span class="hljs-comment"># loadmodule /path/to/other_module.so</span><br><br><span class="hljs-comment">################################## 网络 #####################################</span><br><br><span class="hljs-comment"># 默认情况下，如果未指定“ bind”配置指令，则Redis侦听来自服务器上所有可用网络接口的连接。</span><br><span class="hljs-comment"># 使用以下功能可以只收听一个或多个所选接口</span><br><span class="hljs-comment"># “ bind”配置指令，后跟一个或多个IP地址。</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># Examples:</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># bind 192.168.1.100 10.0.0.1</span><br><span class="hljs-comment"># bind 127.0.0.1 ::1</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># ~~~ WARNING ~~~ 如果运行Redis的计算机直接暴露于 Internet，则绑定到所有接口都是很危险的，</span><br><span class="hljs-comment"># 并且会将实例暴露给 Internet上 的所有人。因此，默认情况下，我们取消注释以下 bind 指令，它将强制 Redis 仅侦听 IPv4 环回接口地址（这意味着 Redis 将只能接受本机访问）。</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># 如果你确定你想将实例取监听所有的地址，只要放在下面一行即可。</span><br><span class="hljs-built_in">bind</span> 127.0.0.1<br><br><span class="hljs-comment"># Protected mode is a layer of security protection, in order to avoid that</span><br><span class="hljs-comment"># Redis instances left open on the internet are accessed and exploited. </span><br><span class="hljs-comment"># 保护模式是一层安全保护，以避免Internet上打开的Redis实例访问和利用。</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># 如下情况需要启用保护模式时：</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># 1) 服务器未使用 bind 命令明确绑定到一组地址。</span><br><span class="hljs-comment"># 2) 没有配置密码。</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># 服务器接受以下集中方式连接：</span><br><span class="hljs-comment"># IPv4 and IPv6 loopback addresses 127.0.0.1 and ::1, and from Unix domain</span><br><span class="hljs-comment"># sockets.</span><br>protected-mode yes<br><br><span class="hljs-comment"># Accept connections on the specified port, 默认端口 is 6379 (IANA #815344).</span><br><span class="hljs-comment"># If port 0 is specified 则Redis将不会在TCP套接字上侦听.</span><br>port 6379<br><br><span class="hljs-comment"># TCP listen() backlog.</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># In high requests-per-second environments you need an high backlog in order</span><br><span class="hljs-comment"># to avoid slow clients connections issues. Note that the Linux kernel</span><br><span class="hljs-comment"># will silently truncate it to the value of /proc/sys/net/core/somaxconn so</span><br><span class="hljs-comment"># make sure to raise both the value of somaxconn and tcp_max_syn_backlog</span><br><span class="hljs-comment"># in order to get the desired effect. </span><br><span class="hljs-comment"># 此参数确定了TCP连接中已完成队列(完成三次握手之后)的长度， 当然此值必须不大于Linux系统定义的/proc/sys/net/core/somaxconn值，默认是511，而Linux的默认参数值是128。当系统并发量大并且客户端速度缓慢的时候，可以将这二个参数一起参考设定。</span><br><span class="hljs-comment"># 对于负载很大的服务程序来说大大的不够。一般会将 somaxconn值 修改为2048或者更大。</span><br>tcp-backlog 511<br><br><span class="hljs-comment"># Unix socket.</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># Specify the path for the Unix socket that will be used to listen for</span><br><span class="hljs-comment"># incoming connections. There is no default, so Redis will not listen</span><br><span class="hljs-comment"># on a unix socket when not specified.</span><br><span class="hljs-comment"># 指定用于监听传入连接的 Unix 套接字的路径。没有默认值，因此在未指定 Redis 的情况下，Redis 不会在 Unix 套接字上侦听。</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># unixsocket /tmp/redis.sock</span><br><span class="hljs-comment"># unixsocketperm 700</span><br><br><span class="hljs-comment"># 客户端闲置N秒后关闭连接 (0 不关闭)</span><br>timeout 0<br><br><span class="hljs-comment"># TCP keepalive.</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># If non-zero, use SO_KEEPALIVE to send TCP ACKs to clients in absence</span><br><span class="hljs-comment"># of communication. This is useful for two reasons:</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># 1) Detect dead peers.</span><br><span class="hljs-comment"># 2) Take the connection alive from the point of view of network</span><br><span class="hljs-comment">#    equipment in the middle.</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># On Linux, the specified value (in seconds) is the period used to send ACKs.</span><br><span class="hljs-comment"># Note that to close the connection the double of the time is needed.</span><br><span class="hljs-comment"># On other kernels the period depends on the kernel configuration.</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># A reasonable value for this option is 300 seconds, which is the new</span><br><span class="hljs-comment"># Redis default starting with Redis 3.2.1.</span><br><span class="hljs-comment"># 定时向 client 发送 tcp_ack 包来探测 client 是否存活的，单位（秒）。</span><br>tcp-keepalive 300<br><br><span class="hljs-comment">################################# GENERAL #####################################</span><br><br><span class="hljs-comment"># By default Redis does not run as a daemon（守护进程）. Use &#x27;yes&#x27; if you need it.</span><br><span class="hljs-comment"># Note that Redis will write a pid file in /var/run/redis.pid when daemonized.</span><br><span class="hljs-comment"># 默认情况下，Redis不会作为守护进程（守护进程）运行。 如果需要，请使用“是”。请注意，Redis 守护进程将在 /var/run/redis.pid 中写入一个 pid 文件。</span><br>daemonize no<br><br><span class="hljs-comment"># If you run Redis from upstart or systemd, Redis can interact with your</span><br><span class="hljs-comment"># supervision tree. Options:	可以通过upstart和systemd管理Redis守护进程</span><br><span class="hljs-comment">#   supervised no      - no supervision interaction</span><br><span class="hljs-comment">#		没有监督互动</span><br><span class="hljs-comment">#   supervised upstart - signal upstart by putting Redis into SIGSTOP mode</span><br><span class="hljs-comment">#		通过将Redis置于SIGSTOP模式来启动信号</span><br><span class="hljs-comment">#   supervised systemd - signal systemd by writing READY=1 to $NOTIFY_SOCKET</span><br><span class="hljs-comment">#		signal systemd将READY = 1写入$ NOTIFY_SOCKET</span><br><span class="hljs-comment">#   supervised auto    - detect upstart or systemd method based on</span><br><span class="hljs-comment">#                        UPSTART_JOB or NOTIFY_SOCKET environment variables</span><br><span class="hljs-comment">#		检测upstart或systemd方法基于 UPSTART_JOB或NOTIFY_SOCKET环境变量</span><br><span class="hljs-comment"># Note: these supervision methods only signal &quot;process is ready.&quot;</span><br><span class="hljs-comment">#       They do not enable continuous liveness pings back to your supervisor.</span><br>supervised no<br><br><span class="hljs-comment"># If a pid file is specified, Redis writes it where specified at startup</span><br><span class="hljs-comment"># and removes it at exit. </span><br><span class="hljs-comment"># 如果指定了 pid 文件，则 Redis 会在启动时将其写入指定位置，然后在退出时将其删除。</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># When the server runs non daemonized, no pid file is created if none is</span><br><span class="hljs-comment"># specified in the configuration. When the server is daemonized, the pid file</span><br><span class="hljs-comment"># is used even if not specified, defaulting to &quot;/var/run/redis.pid&quot;.</span><br><span class="hljs-comment"># 当服务器在非守护进程下运行时，如果没有pid文件，则不会创建在配置中指定。守护服务器时，即使未指定，也会使用pid文件，默认为“ /var/run/redis.pid”。</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># Creating a pid file is best effort: if Redis is not able to create it</span><br><span class="hljs-comment"># nothing bad happens, the server will start and run normally.</span><br>pidfile /var/run/redis_6379.pid<br><br><span class="hljs-comment"># Specify the server verbosity level.</span><br><span class="hljs-comment"># This can be one of:</span><br><span class="hljs-comment"># debug (a lot of information, useful for development/testing)</span><br><span class="hljs-comment"># verbose (many rarely useful info, but not a mess like the debug level)</span><br><span class="hljs-comment"># notice (moderately verbose, what you want in production probably)</span><br><span class="hljs-comment"># warning (only very important / critical messages are logged)</span><br>loglevel notice<br><br><span class="hljs-comment"># Specify the log file name. Also the empty string can be used to force</span><br><span class="hljs-comment"># Redis to log on the standard output. Note that if you use standard</span><br><span class="hljs-comment"># output for logging but daemonize, logs will be sent to /dev/null</span><br>logfile <span class="hljs-string">&quot;&quot;</span><br><br><span class="hljs-comment"># To enable logging to the system logger, just set &#x27;syslog-enabled&#x27; to yes,</span><br><span class="hljs-comment"># and optionally update the other syslog parameters to suit your needs.</span><br><span class="hljs-comment"># 是否打开记录syslog功能</span><br><span class="hljs-comment"># syslog-enabled no</span><br><br><span class="hljs-comment"># Specify the syslog identity. 	syslog的标识符</span><br><span class="hljs-comment"># syslog-ident redis</span><br><br><span class="hljs-comment"># Specify the syslog facility. Must be USER or between LOCAL0-LOCAL7.	日志的来源、设备</span><br><span class="hljs-comment"># syslog-facility local0</span><br><br><span class="hljs-comment"># Set the number of databases. The default database is DB 0, you can select</span><br><span class="hljs-comment"># a different one on a per-connection basis using SELECT &lt;dbid&gt; where</span><br><span class="hljs-comment"># dbid is a number between 0 and &#x27;databases&#x27;-1</span><br><span class="hljs-comment"># 默认 16 个库</span><br>databases 16<br><br><span class="hljs-comment"># By default Redis shows an ASCII art logo only when started to log to the</span><br><span class="hljs-comment"># standard output and if the standard output is a TTY. Basically this means</span><br><span class="hljs-comment"># that normally a logo is displayed only in interactive sessions.</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># However it is possible to force the pre-4.0 behavior and always show a</span><br><span class="hljs-comment"># ASCII art logo in startup logs by setting the following option to yes.</span><br>always-show-logo yes<br><br><span class="hljs-comment">################################ SNAPSHOTTING 磁盘快照 ################################</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># Save the DB on disk:</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment">#   save &lt;seconds&gt; &lt;changes&gt;</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment">#   Will save the DB if both the given number of seconds and the given</span><br><span class="hljs-comment">#   number of write operations against the DB occurred.</span><br><span class="hljs-comment"># 如果同时发生了给定的秒数和给定的针对数据库的写操作数，则将保存数据库。</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment">#   In the example below the behaviour will be to save:</span><br><span class="hljs-comment">#   after 900 sec (15 min) if at least 1 key changed</span><br><span class="hljs-comment">#   after 300 sec (5 min) if at least 10 keys changed</span><br><span class="hljs-comment">#   after 60 sec if at least 10000 keys changed</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment">#   Note: you can disable saving completely by commenting out all &quot;save&quot; lines.</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment">#   It is also possible to remove all the previously configured save</span><br><span class="hljs-comment">#   points by adding a save directive with a single empty string argument</span><br><span class="hljs-comment">#   like in the following example:</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment">#   save &quot;&quot;</span><br><span class="hljs-comment"># 磁盘快照根据 redis key修改频率不同，设置不同的备份规则</span><br>save 900 1<br>save 300 10<br>save 60 10000<br><br><span class="hljs-comment"># By default Redis will stop accepting writes if RDB snapshots are enabled</span><br><span class="hljs-comment"># (at least one save point) and the latest background save failed.</span><br><span class="hljs-comment"># This will make the user aware (in a hard way) that data is not persisting</span><br><span class="hljs-comment"># on disk properly, otherwise chances are that no one will notice and some</span><br><span class="hljs-comment"># disaster will happen.</span><br><span class="hljs-comment"># 默认情况下，如果启用RDB快照（至少一个保存点）。并且最新的后台保存失败，则Redis将停止接受写入。这将使用户（以一种困难的方式）意识到数据无法正确地持久存储在磁盘上，否则，可能没人会注意到并且会发生一些灾难。</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># If the background saving process will start working again Redis will</span><br><span class="hljs-comment"># automatically allow writes again.</span><br><span class="hljs-comment"># 如果后台保存过程再次开始工作，则 Redis 将自动允许再次写入。</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># However if you have setup your proper monitoring of the Redis server</span><br><span class="hljs-comment"># and persistence, you may want to disable this feature so that Redis will</span><br><span class="hljs-comment"># continue to work as usual even if there are problems with disk,</span><br><span class="hljs-comment"># permissions, and so forth.</span><br><span class="hljs-comment"># 但是，如果您设置了对 Redis 服务器和持久性的适当监视，则可能希望禁用此功能，以便即使磁盘，权限等出现问题，Redis 仍将继续照常工作（如果设置了监听，可以考虑关掉此设置）。</span><br>stop-writes-on-bgsave-error yes<br><br><span class="hljs-comment"># Compress string objects using LZF when dump .rdb databases?</span><br><span class="hljs-comment"># For default that&#x27;s set to &#x27;yes&#x27; as it&#x27;s almost always a win.</span><br><span class="hljs-comment"># If you want to save some CPU in the saving child set it to &#x27;no&#x27; but</span><br><span class="hljs-comment"># the dataset will likely be bigger if you have compressible values or keys.</span><br>rdbcompression yes<br><br><span class="hljs-comment"># 从RDB版本5开始，CRC64校验和位于文件末尾。这使得该格式更能抵抗损坏，但是在保存和加载 RDB文件时会</span><br><span class="hljs-comment"># 付出一定的性能损失（大约10％），因此可以禁用该格式以实现最佳性能。</span><br><span class="hljs-comment"># 在禁用校验和的情况下创建的RDB文件的校验和为零，这将指示加载代码跳过该校验。</span><br>rdbchecksum yes<br><br><span class="hljs-comment"># The filename where to dump the DB</span><br>dbfilename dump.rdb<br><br><span class="hljs-comment"># The working directory.</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># The DB will be written inside this directory, with the filename specified</span><br><span class="hljs-comment"># above using the &#x27;dbfilename&#x27; configuration directive.</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># The Append Only File will also be created inside this directory.</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># Note that you must specify a directory here, not a file name.</span><br><span class="hljs-comment"># 数据目录，数据库的写入会在这个目录。rdb、aof文件也会写在这个目录</span><br><span class="hljs-comment"># dir ./</span><br> dir /home/www/redis/data/<br><br><span class="hljs-comment">################################# REPLICATION 主从复制#################################</span><br><br><span class="hljs-comment"># Master-Replica replication. Use replicaof to make a Redis instance a copy of</span><br><span class="hljs-comment"># another Redis server. A few things to understand ASAP about Redis replication.</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment">#   +------------------+      +---------------+</span><br><span class="hljs-comment">#   |      Master      | ---&gt; |    Replica    |</span><br><span class="hljs-comment">#   | (receive writes) |      |  (exact copy) |</span><br><span class="hljs-comment">#   +------------------+      +---------------+</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># 1) Redis replication is asynchronous, but you can configure a master to</span><br><span class="hljs-comment">#    stop accepting writes if it appears to be not connected with at least</span><br><span class="hljs-comment">#    a given number of replicas.</span><br><span class="hljs-comment"># Redis复制是异步的，但如果没有链接至少一个拷贝副本，可以设置主服务器停止接受写入。</span><br><span class="hljs-comment"># 2) Redis replicas are able to perform a partial resynchronization with the</span><br><span class="hljs-comment">#    master if the replication link is lost for a relatively small amount of</span><br><span class="hljs-comment">#    time. You may want to configure the replication backlog size (see the next</span><br><span class="hljs-comment">#    sections of this file) with a sensible value depending on your needs.</span><br><span class="hljs-comment"># 短时间内，如果 redis 副本丢失相对较少的复制链接，redis副本可以实现与主服务器重新同步丢是的数据。</span><br><span class="hljs-comment"># 这里可能需要根据需要将复制 backlog 大小配置为合理的值。</span><br><span class="hljs-comment"># 3) Replication is automatic and does not need user intervention. After a</span><br><span class="hljs-comment">#    network partition replicas automatically try to reconnect to masters</span><br><span class="hljs-comment">#    and resynchronize with them.</span><br><span class="hljs-comment"># 复制是自动的，不需要用户干预。网络分区副本会自动尝试重新连接到主服务器并与他们重新同步。</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># 命令</span><br><span class="hljs-comment"># replicaof &lt;masterip&gt; &lt;masterport&gt;</span><br><br><span class="hljs-comment"># If the master is password protected (using the &quot;requirepass&quot; configuration</span><br><span class="hljs-comment"># directive below) it is possible to tell the replica to authenticate before</span><br><span class="hljs-comment"># starting the replication synchronization process, otherwise the master will</span><br><span class="hljs-comment"># refuse the replica request.</span><br><span class="hljs-comment"># 如果主服务器受密码保护（使用下面的“ requirepass”配置指令），则可以在开始复制同步过程之前</span><br><span class="hljs-comment"># 告诉副本服务器进行身份验证，否则主服务器将拒绝副本请求。</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># masterauth &lt;master-password&gt;</span><br><br><span class="hljs-comment"># When a replica loses its connection with the master, or when the replication</span><br><span class="hljs-comment"># is still in progress, the replica can act in two different ways:</span><br><span class="hljs-comment"># 当副本失去与主数据库的连接时，或者当复制仍在进行中，副本可以以两种不同的方式起作用：</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># 1) if replica-serve-stale-data is set to &#x27;yes&#x27; (the default) the replica will</span><br><span class="hljs-comment">#    still reply to client requests, possibly with out of date data（过期数据）, or the</span><br><span class="hljs-comment">#    data set may just be empty if this is the first synchronization.</span><br><span class="hljs-comment"># 	 从库会继续响应客户端的请求</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># 2) if replica-serve-stale-data is set to &#x27;no&#x27; the replica will reply with</span><br><span class="hljs-comment">#    an error &quot;SYNC with master in progress&quot; to all the kind of commands</span><br><span class="hljs-comment">#    but to INFO, replicaOF, AUTH, PING, SHUTDOWN, REPLCONF, ROLE, CONFIG,</span><br><span class="hljs-comment">#    SUBSCRIBE, UNSUBSCRIBE, PSUBSCRIBE, PUNSUBSCRIBE, PUBLISH, PUBSUB,</span><br><span class="hljs-comment">#    COMMAND, POST, HOST: and LATENCY.</span><br><span class="hljs-comment">#	 上述命令之外的任何请求都会返回一个错误”SYNC with master in progress”</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># 从服务器稳定输出，不报错（都是连接或数据为空）</span><br>replica-serve-stale-data yes<br><br><span class="hljs-comment"># You can configure a replica instance to accept writes or not. Writing against</span><br><span class="hljs-comment"># a replica instance may be useful to store some ephemeral data (because data</span><br><span class="hljs-comment"># written on a replica will be easily deleted after resync with the master) but</span><br><span class="hljs-comment"># may also cause problems if clients are writing to it because of a</span><br><span class="hljs-comment"># misconfiguration.</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># Since Redis 2.6 by default replicas are read-only.</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># Note: read only replicas are not designed to be exposed to untrusted clients</span><br><span class="hljs-comment"># on the internet. It&#x27;s just a protection layer against misuse of the instance.</span><br><span class="hljs-comment"># Still a read only replica exports by default all the administrative commands</span><br><span class="hljs-comment"># such as CONFIG, DEBUG, and so forth. To a limited extent you can improve</span><br><span class="hljs-comment"># security of read only replicas using &#x27;rename-command&#x27; to shadow all the</span><br><span class="hljs-comment"># administrative / dangerous commands.</span><br><span class="hljs-comment"># 从服务器只读</span><br>replica-read-only yes<br><br><span class="hljs-comment"># Replication SYNC strategy: disk or socket.</span><br><span class="hljs-comment"># 复制SYNC策略：磁盘或套接字。</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># -------------------------------------------------------</span><br><span class="hljs-comment"># WARNING: DISKLESS REPLICATION IS EXPERIMENTAL CURRENTLY</span><br><span class="hljs-comment"># -------------------------------------------------------</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># New replicas and reconnecting replicas that are not able to continue the replication</span><br><span class="hljs-comment"># process just receiving differences, need to do what is called a &quot;full</span><br><span class="hljs-comment"># synchronization&quot;. An RDB file is transmitted from the master to the replicas.</span><br><span class="hljs-comment"># The transmission can happen in two different ways:</span><br><span class="hljs-comment"># 仅接收差异而无法继续复制过程的新副本和重新连接的副本需要执行所谓的“完全同步”。 </span><br><span class="hljs-comment"># RDB文件从主数据库传输到副本数据库。 传输可以通过两种不同的方式进行：</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># 1) Disk-backed: The Redis master creates a new process that writes the RDB</span><br><span class="hljs-comment">#                 file on disk. Later the file is transferred by the parent</span><br><span class="hljs-comment">#                 process to the replicas incrementally.</span><br><span class="hljs-comment"># Redis主服务器创建一个新过程，将RDB文件写入磁盘。 后来，文件由父进程逐步传输到副本。</span><br><span class="hljs-comment"># 2) Diskless: The Redis master creates a new process that directly writes the</span><br><span class="hljs-comment">#              RDB file to replica sockets, without touching the disk at all.</span><br><span class="hljs-comment"># Redis主服务器创建一个新进程，该进程将RDB文件直接写入副本套接字，而完全不接触磁盘。</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># With disk-backed replication, while the RDB file is generated, more replicas</span><br><span class="hljs-comment"># can be queued and served with the RDB file as soon as the current child producing</span><br><span class="hljs-comment"># the RDB file finishes its work. With diskless replication instead once</span><br><span class="hljs-comment"># the transfer starts, new replicas arriving will be queued and a new transfer</span><br><span class="hljs-comment"># will start when the current one terminates.</span><br><span class="hljs-comment"># 使用磁盘支持的复制，在生成RDB文件的同时，只要生成RDB文件的当前子级完成工作，</span><br><span class="hljs-comment"># 以将更多副本排入队列并与RDB文件一起使用。 如果使用无盘复制，则一旦传输开始，</span><br><span class="hljs-comment"># 副本将排队，并且当当前副本终止时将开始新的传输。</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># When diskless replication is used, the master waits a configurable amount of</span><br><span class="hljs-comment"># time (in seconds) before starting the transfer in the hope that multiple replicas</span><br><span class="hljs-comment"># will arrive and the transfer can be parallelized.</span><br><span class="hljs-comment"># 使用无盘复制时，主服务器在开始传输之前会等待一段可配置的时间（以秒为单位），以希望多个副本可以到达并且传输可以并行化。</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># With slow disks and fast (large bandwidth) networks, diskless replication</span><br><span class="hljs-comment"># works better. 使用慢速磁盘和快速（大带宽）网络，无盘复制效果更好</span><br>repl-diskless-sync no<br><br><span class="hljs-comment"># When diskless replication is enabled, it is possible to configure the delay</span><br><span class="hljs-comment"># the server waits in order to spawn the child that transfers the RDB via socket</span><br><span class="hljs-comment"># to the replicas.</span><br><span class="hljs-comment"># 启用无盘复制后，可以配置服务器等待的延迟，以便生成通过套接字将RDB传输到副本的子代。</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># This is important since once the transfer starts, it is not possible to serve</span><br><span class="hljs-comment"># new replicas arriving, that will be queued for the next RDB transfer, so the server</span><br><span class="hljs-comment"># waits a delay in order to let more replicas arrive.</span><br><span class="hljs-comment"># 这一点很重要，因为一旦传输开始，就无法为到达下一个RDB传输的新副本提供服务，因此服务器会等待一段时间，以便让更多副本到达。</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># The delay is specified in seconds, and by default is 5 seconds. To disable</span><br><span class="hljs-comment"># it entirely just set it to 0 seconds and the transfer will start ASAP（尽快）</span><br>repl-diskless-sync-delay 5<br><br><span class="hljs-comment"># Replicas send PINGs to server in a predefined interval. It&#x27;s possible to change</span><br><span class="hljs-comment"># this interval with the repl_ping_replica_period option. The default value is 10</span><br><span class="hljs-comment"># seconds.</span><br><span class="hljs-comment"># 从服务器以预定义的时间间隔将 PING 发送到主服务器。 可以使用 repl_ping_replica_period 选项更改此间隔。 默认值为10秒。 </span><br><span class="hljs-comment"># repl-ping-replica-period 10</span><br><br><span class="hljs-comment"># The following option sets the replication timeout for:</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># 1) Bulk transfer I/O during SYNC, from the point of view of replica.</span><br><span class="hljs-comment"># 2) Master timeout from the point of view of replicas (data, pings).</span><br><span class="hljs-comment"># 3) Replica timeout from t</span><br><span class="hljs-comment">#e point of view of masters (REPLCONF ACK pings).</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># It is important to make sure that this value is greater than the value</span><br><span class="hljs-comment"># specified for repl-ping-replica-period otherwise a timeout will be detected</span><br><span class="hljs-comment"># every time there is low traffic between the master and the replica.</span><br><span class="hljs-comment"># 值要大于 repl-ping-replica-period 的值，不然每次都会检测为超时。</span><br><span class="hljs-comment"># repl-timeout 60</span><br><br><span class="hljs-comment"># Disable TCP_NODELAY on the replica socket after SYNC?</span><br><span class="hljs-comment"># 在同步后禁用副本套接字上的TCP_NODELAY？</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># If you select &quot;yes&quot; Redis will use a smaller number of TCP packets and</span><br><span class="hljs-comment"># less bandwidth to send data to replicas. But this can add a delay for</span><br><span class="hljs-comment"># the data to appear on the replica side, up to 40 milliseconds with</span><br><span class="hljs-comment"># Linux kernels using a default configuration.（减少带宽，增加从服务器延迟）</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># If you select &quot;no&quot; the delay for data to appear on the replica side will</span><br><span class="hljs-comment"># be reduced but more bandwidth will be used for replication.（增加带宽，减少从服务器延迟）</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># By default we optimize for low latency, but in very high traffic conditions</span><br><span class="hljs-comment"># or when the master and replicas are many hops away, turning this to &quot;yes&quot; may</span><br><span class="hljs-comment"># be a good idea.（在流量非常高的情况下，或者在距离主服务器和副本很多跳的情况下，将其设置为“是”可能是个好主意。）</span><br>repl-disable-tcp-nodelay no<br><br><span class="hljs-comment"># Set the replication backlog size. The backlog is a buffer that accumulates</span><br><span class="hljs-comment"># replica data when replicas are disconnected for some time, so that when a replica</span><br><span class="hljs-comment"># wants to reconnect again, often a full resync is not needed, but a partial</span><br><span class="hljs-comment"># resync is enough, just passing the portion of data the replica missed while</span><br><span class="hljs-comment"># disconnected.（设置从服务器 backlog 大小，以便于从服务器断开连接一段时间，它可以缓冲部分数据。因此，当从服务器重新连接时，不需要完全同步，只同步缓冲区中的数据即可。）</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># The bigger the replication backlog, the longer the time the replica can be</span><br><span class="hljs-comment"># disconnected and later be able to perform a partial resynchronization.</span><br><span class="hljs-comment"># repl-backlog-size 值越大，从服务器可以断开连接并在下次重新连接同步时间越长。</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># The backlog is only allocated once there is at least a replica connected.</span><br><span class="hljs-comment"># 仅当至少有一个副本连接时，才分配 backlog。</span><br><span class="hljs-comment"># repl-backlog-size 1mb</span><br><br><span class="hljs-comment"># After a master has no longer connected replicas for some time, the backlog</span><br><span class="hljs-comment"># will be freed. The following option configures the amount of seconds that</span><br><span class="hljs-comment"># need to elapse, starting from the time the last replica disconnected, for</span><br><span class="hljs-comment"># the backlog buffer to be freed.</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># Note that replicas never free the backlog for timeout, since they may be</span><br><span class="hljs-comment"># promoted to masters later, and should be able to correctly &quot;partially</span><br><span class="hljs-comment"># resynchronize&quot; with the replicas: hence they should always accumulate backlog.</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># A value of 0 means to never release the backlog.</span><br><span class="hljs-comment">#	主服务器断开与从服务器连接到释放 backlog 缓冲区时间。0 意味着不释放缓冲区。（从服务器不会释放缓冲区）</span><br><span class="hljs-comment"># repl-backlog-ttl 3600</span><br><br><span class="hljs-comment"># The replica priority is an integer number published by Redis in the INFO output.</span><br><span class="hljs-comment"># It is used by Redis Sentinel in order to select a replica to promote into a</span><br><span class="hljs-comment"># master if the master is no longer working correctly.</span><br><span class="hljs-comment"># 副本优先级是 Redis 在 INFO 输出中发布的整数。如果主服务器不再正常工作，Redis Sentinel 会使用它来选择要升级为主服务器的副本。</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># A replica with a low priority number is considered better for promotion, so</span><br><span class="hljs-comment"># for instance if there are three replicas with priority 10, 100, 25 Sentinel will</span><br><span class="hljs-comment"># pick the one with priority 10, that is the lowest.</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># However a special priority of 0 marks the replica as not able to perform the</span><br><span class="hljs-comment"># role of master, so a replica with priority of 0 will never be selected by</span><br><span class="hljs-comment"># Redis Sentinel for promotion.（优先级不能设置为 0,设置为 0 不是被升级为主服务器）</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># By default the priority is 100.</span><br>replica-priority 100<br><br><span class="hljs-comment"># It is possible for a master to stop accepting writes if there are less than</span><br><span class="hljs-comment"># N replicas connected, having a lag less or equal than M seconds.</span><br><span class="hljs-comment"># 如果连接的副本少于N个，并且延迟小于或等于M秒，则主服务器可能会停止接受写入。</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># The N replicas need to be in &quot;online&quot; state.</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># The lag in seconds, that must be &lt;= the specified value, is calculated from</span><br><span class="hljs-comment"># the last ping received from the replica, that is usually sent every second.</span><br><span class="hljs-comment"># 延迟（以秒为单位）必须小于等于指定值，该延迟是根据从副本接收到的最后ping（通常每秒发送一次）计算得出的。</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># This option does not GUARANTEE that N replicas will accept the write, but</span><br><span class="hljs-comment"># will limit the window of exposure for lost writes in case not enough replicas</span><br><span class="hljs-comment"># are available, to the specified number of seconds.</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># For example to require at least 3 replicas with a lag &lt;= 10 seconds use:</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># min-replicas-to-write 3</span><br><span class="hljs-comment"># min-replicas-max-lag 10</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># Setting one or the other to 0 disables the feature.</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># By default min-replicas-to-write is set to 0 (feature disabled) and</span><br><span class="hljs-comment"># min-replicas-max-lag is set to 10.</span><br><br><span class="hljs-comment"># A Redis master is able to list the address and port of the attached</span><br><span class="hljs-comment"># replicas in different ways. For example the &quot;INFO replication&quot; section</span><br><span class="hljs-comment"># offers this information, which is used, among other tools, by</span><br><span class="hljs-comment"># Redis Sentinel in order to discover replica instances.</span><br><span class="hljs-comment"># Another place where this info is available is in the output of the</span><br><span class="hljs-comment"># &quot;ROLE&quot; command of a master.</span><br><span class="hljs-comment"># Redis主服务器能够以不同方式列出附加副本的地址和端口。 例如，“ INFO复制”部分提供了此信息，</span><br><span class="hljs-comment"># Redis Sentinel使用此信息以及其他工具来发现副本实例。 该信息可用的另一个位置是主服务器的“ ROLE”命令的输出。</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># The listed IP and address normally reported by a replica is obtained</span><br><span class="hljs-comment"># in the following way:</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment">#   IP: The address is auto detected by checking the peer address</span><br><span class="hljs-comment">#   of the socket used by the replica to connect with the master.</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment">#   Port: The port is communicated by the replica during the replication</span><br><span class="hljs-comment">#   handshake, and is normally the port that the replica is using to</span><br><span class="hljs-comment">#   listen for connections.</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># However when port forwarding or Network Address Translation (NAT) is</span><br><span class="hljs-comment"># used, the replica may be actually reachable via different IP and port</span><br><span class="hljs-comment"># pairs. The following two options can be used by a replica in order to</span><br><span class="hljs-comment"># report to its master a specific set of IP and port, so that both INFO</span><br><span class="hljs-comment"># and ROLE will report those values.</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># There is no need to use both the options if you need to override just</span><br><span class="hljs-comment"># the port or the IP address.</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># replica-announce-ip 5.5.5.5</span><br><span class="hljs-comment"># replica-announce-port 1234</span><br><br><span class="hljs-comment">################################## SECURITY 安全 ###################################</span><br><br><span class="hljs-comment"># Require clients to issue AUTH &lt;PASSWORD&gt; before processing any other</span><br><span class="hljs-comment"># commands.  This might be useful in environments in which you do not trust</span><br><span class="hljs-comment"># others with access to the host running redis-server.</span><br><span class="hljs-comment"># 要求客户端在处理任何其他命令之前发出AUTH &lt;PASSWORD&gt;。 </span><br><span class="hljs-comment"># 在您不信任其他人无法访问运行redis-server的主机的环境中，这可能很有用。</span><br><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># This should stay commented out for backward compatibility and because most</span><br><span class="hljs-comment"># people do not need auth (e.g. they run their own servers).</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># Warning: since Redis is pretty fast an outside user can try up to</span><br><span class="hljs-comment"># 150k passwords per second against a good box. This means that you should</span><br><span class="hljs-comment"># use a very strong password otherwise it will be very easy to break.</span><br><span class="hljs-comment"># requirepass 配置可以让用户使用 AUTH 命令来认证密码，才能使用其他命令。这让 redis 可以使用在不受信任的网络中。为了保持向后的兼容性，可以注释该命令，因为大部分用户也不需要认证。使用 requirepass 的时候需要注意，因为 redis 太快了，每秒可以认证 15w 次密码，简单的密码很容易被攻破，所以最好使用一个更复杂的密码</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># requirepass foobared</span><br><br><span class="hljs-comment"># Command renaming.</span><br><span class="hljs-comment"># 命令重命名</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># It is possible to change the name of dangerous commands in a shared</span><br><span class="hljs-comment"># environment. For instance the CONFIG command may be renamed into something</span><br><span class="hljs-comment"># hard to guess so that it will still be available for internal-use tools</span><br><span class="hljs-comment"># but not available for general clients.</span><br><span class="hljs-comment"># 可以在共享环境中更改危险命令的名称。 例如，可以将CONFIG命令重命名为一些难以猜测的名称，</span><br><span class="hljs-comment"># 以便它仍可用于内部使用的工具，但不适用于一般客户。</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># Example:</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># rename-command CONFIG b840fc02d524045429941cc15f59e41cb7be6c52</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># It is also possible to completely kill a command by renaming it into</span><br><span class="hljs-comment"># an empty string:</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># rename-command CONFIG &quot;&quot;</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># Please note that changing the name of commands that are logged into the</span><br><span class="hljs-comment"># AOF file or transmitted to replicas may cause problems.</span><br><span class="hljs-comment"># 请注意，更改 命令名称 记录到AOF文件或传输到副本可能会导致问题。</span><br><br><span class="hljs-comment">################################### CLIENTS 客户端 ####################################</span><br><br><span class="hljs-comment"># Set the max number of connected clients at the same time. By default</span><br><span class="hljs-comment"># this limit is set to 10000 clients, however if the Redis server is not</span><br><span class="hljs-comment"># able to configure the process file limit to allow for the specified limit</span><br><span class="hljs-comment"># the max number of allowed clients is set to the current file limit</span><br><span class="hljs-comment"># minus 32 (as Redis reserves a few file descriptors for internal uses).</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># Once the limit is reached Redis will close all the new connections sending</span><br><span class="hljs-comment"># an error &#x27;max number of clients reached&#x27;.</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># 同一时间最大客户端连接数</span><br><span class="hljs-comment"># maxclients 10000</span><br><br><span class="hljs-comment">############################## MEMORY MANAGEMENT 内存管理 ################################</span><br><br><span class="hljs-comment"># Set a memory usage limit to the specified amount of bytes.</span><br><span class="hljs-comment"># When the memory limit is reached Redis will try to remove keys</span><br><span class="hljs-comment"># according to the eviction policy selected (see maxmemory-policy).</span><br><span class="hljs-comment"># 将内存使用限制设置为指定的字节数。当达到内存限制时，Redis将根据选择的搬迁策略，尝试删除 key。</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># If Redis can&#x27;t remove keys according to the policy, or if the policy is</span><br><span class="hljs-comment"># set to &#x27;noeviction&#x27;, Redis will start to reply with errors to commands</span><br><span class="hljs-comment"># that would use more memory, like SET, LPUSH, and so on, and will continue</span><br><span class="hljs-comment"># to reply to read-only commands like GET.</span><br><span class="hljs-comment"># 如果Redis无法根据策略删除 key，或者如果策略设置为“ noeviction”，Redis将开始响应命令错误</span><br><span class="hljs-comment"># 这将使用更多的内存，例如SET，LPUSH等些命令，但仍可以继续回复诸如GET之类的只读命令。</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># This option is usually useful when using Redis as an LRU or LFU cache, or to</span><br><span class="hljs-comment"># set a hard memory limit for an instance (using the &#x27;noeviction&#x27; policy).</span><br><span class="hljs-comment"># 当将Redis用作LRU或LFU缓存时，设置实例的硬性内存限制，此选项通常很有用。</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># WARNING: If you have replicas attached to an instance with maxmemory on,</span><br><span class="hljs-comment"># the size of the output buffers needed to feed the replicas are subtracted</span><br><span class="hljs-comment"># from the used memory count, so that network problems / resyncs will</span><br><span class="hljs-comment"># not trigger a loop where keys are evicted, and in turn the output</span><br><span class="hljs-comment"># buffer of replicas is full with DELs of keys evicted triggering the deletion</span><br><span class="hljs-comment"># of more keys, and so forth until the database is completely emptied.</span><br><span class="hljs-comment"># 如果您将副本附加到具有maxmemory的实例，减去提供副本所需的输出缓冲区的大小</span><br><span class="hljs-comment"># 从已用内存计数中，以便网络问题/重新同步不会触发退出键的循环，进而导致输出</span><br><span class="hljs-comment"># 副本缓冲区已满，有逐出的DEL键触发删除直到数据库完全清空为止。</span><br><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># In short... if you have replicas attached it is suggested that you set a lower</span><br><span class="hljs-comment"># limit for maxmemory so that there is some free RAM on the system for replica</span><br><span class="hljs-comment"># output buffers (but this is not needed if the policy is &#x27;noeviction&#x27;).</span><br><span class="hljs-comment"># 简而言之...如果您附加了副本，建议您设置一个较低的 maxmemory 的限制，</span><br><span class="hljs-comment"># 以便系统上有一些可用的RAM用于复制输出缓冲区（但是如果策略为“ noeviction”，则不需要这样做）。</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># maxmemory &lt;bytes&gt;</span><br><br><span class="hljs-comment"># MAXMEMORY POLICY: how Redis will select what to remove when maxmemory</span><br><span class="hljs-comment"># is reached. You can select among five behaviors:</span><br><span class="hljs-comment"># 达到 maxmemory 时，Redis 将如何选择要删除的内容。 您可以选择以下五种行为：</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># volatile-lru -&gt; Evict using approximated LRU among the keys with an expire set.</span><br><span class="hljs-comment"># 使用具有过期时间的 keys 中的近似 LRU 进行驱逐（LRU：Least Recently Used，最近最少使用）。</span><br><span class="hljs-comment"># allkeys-lru -&gt; Evict any key using approximated LRU.</span><br><span class="hljs-comment"># 驱逐任何最近最少使用的 key。</span><br><span class="hljs-comment"># volatile-lfu -&gt; Evict using approximated LFU among the keys with an expire set.</span><br><span class="hljs-comment"># 使用具有过期时间的 keys 中的近似 LFU 进行驱逐（LFU：least frequently used，最不经常使用）。</span><br><span class="hljs-comment"># allkeys-lfu -&gt; Evict any key using approximated LFU.</span><br><span class="hljs-comment"># 驱逐任何最不经常使用的 key。</span><br><span class="hljs-comment"># volatile-random -&gt; Remove a random key among the ones with an expire set.</span><br><span class="hljs-comment"># 随机去除带有过期时间的 key。</span><br><span class="hljs-comment"># allkeys-random -&gt; Remove a random key, any key.</span><br><span class="hljs-comment"># 随机去除任何 key。</span><br><span class="hljs-comment"># volatile-ttl -&gt; Remove the key with the nearest expire time (minor TTL)</span><br><span class="hljs-comment"># 驱逐最接近过期时间的 key。</span><br><span class="hljs-comment"># noeviction -&gt; Don&#x27;t evict anything, just return an error on write operations.</span><br><span class="hljs-comment"># 不驱逐任何东西，仅在写操作时返回错误</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># LRU means Least Recently Used（最近最少使用）</span><br><span class="hljs-comment"># LFU means Least Frequently Used（最不经常使用）</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># Both LRU, LFU and volatile-ttl are implemented using approximated</span><br><span class="hljs-comment"># randomized algorithms. （LRU，LFU和volatile-ttl均使用近似随机算法实现）</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># Note: with any of the above policies, Redis will return an error on write</span><br><span class="hljs-comment">#       operations, when there are no suitable keys for eviction.</span><br><span class="hljs-comment"># 使用上述任何策略，当没有合适的键时驱逐时，Redis将在写入操作中返回错误。</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment">#       At the date of writing these commands are: set setnx setex append</span><br><span class="hljs-comment">#       incr decr rpush lpush rpushx lpushx linsert lset rpoplpush sadd</span><br><span class="hljs-comment">#       sinter sinterstore sunion sunionstore sdiff sdiffstore zadd zincrby</span><br><span class="hljs-comment">#       zunionstore zinterstore hset hsetnx hmset hincrby incrby decrby</span><br><span class="hljs-comment">#       getset mset msetnx exec sort</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># The default is:</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># maxmemory-policy noeviction</span><br><br><span class="hljs-comment"># LRU, LFU and minimal TTL algorithms are not precise algorithms but approximated</span><br><span class="hljs-comment"># algorithms (in order to save memory), so you can tune it for speed or</span><br><span class="hljs-comment"># accuracy. For default Redis will check five keys and pick the one that was</span><br><span class="hljs-comment"># used less recently, you can change the sample size using the following</span><br><span class="hljs-comment"># configuration directive.</span><br><span class="hljs-comment"># LRU，LFU和最小TTL算法不是精确算法，而是近似算法（以节省内存），因此您可以针对速度或准确性进行调整。 </span><br><span class="hljs-comment"># 对于默认情况，Redis将检查 5 个键并选择最近使用少的键，您可以使用以下配置指令更改样本大小。</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># The default of 5 produces good enough results. 10 Approximates very closely</span><br><span class="hljs-comment"># true LRU but costs more CPU. 3 is faster but not very accurate.</span><br><span class="hljs-comment"># 默认值为5会产生足够好的结果。 10非常接近真实的LRU，但是会花费更多的CPU。 3更快，但不是很准确。</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># maxmemory-samples 5</span><br><br><span class="hljs-comment"># Starting from Redis 5, by default a replica will ignore its maxmemory setting</span><br><span class="hljs-comment"># (unless it is promoted to master after a failover or manually). It means</span><br><span class="hljs-comment"># that the eviction of keys will be just handled by the master, sending the</span><br><span class="hljs-comment"># DEL commands to the replica as keys evict in the master side.</span><br><span class="hljs-comment"># 从Redis 5开始，默认情况下，从服务器将忽略其 maxmemory 设置（除非在故障转移后或手动提升为主副本）。</span><br><span class="hljs-comment"># 这意味着 keys 删除将仅由主服务器处理，将 DEL 命令作为副本在主计算机侧逐出，将 DEL 命令发送到副本。</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># This behavior ensures that masters and replicas stay consistent, and is usually</span><br><span class="hljs-comment"># what you want, however if your replica is writable, or you want the replica to have</span><br><span class="hljs-comment"># a different memory setting, and you are sure all the writes performed to the</span><br><span class="hljs-comment"># replica are idempotent, then you may change this default (but be sure to understand</span><br><span class="hljs-comment"># what you are doing).</span><br><span class="hljs-comment"># 此行为可确保主副本和副本始终保持一致，这通常是您想要的，但是，如果副本是可写的，</span><br><span class="hljs-comment"># 或者您希望副本具有不同的内存设置，并且您确定对副本执行的所有写操作都是幂等的， </span><br><span class="hljs-comment"># 那么您可以更改此默认设置（但请务必了解您的操作）。</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># Note that since the replica by default does not evict, it may end using more</span><br><span class="hljs-comment"># memory than the one set via maxmemory (there are certain buffers that may</span><br><span class="hljs-comment"># be larger on the replica, or data structures may sometimes take more memory and so</span><br><span class="hljs-comment"># forth). So make sure you monitor your replicas and make sure they have enough</span><br><span class="hljs-comment"># memory to never hit a real out-of-memory condition before the master hits</span><br><span class="hljs-comment"># the configured maxmemory setting.</span><br><span class="hljs-comment"># 请注意，由于默认情况下该副本不会退出，因此它可能会使用比通过maxmemory设置的内存更多的内存</span><br><span class="hljs-comment">#（某些副本上的某些缓冲区可能更大，或者数据结构有时会占用更多内存等等）。 因此，请确保您监视副本，</span><br><span class="hljs-comment"># 并确保副本具有足够的内存，以确保在主副本达到配置的最大内存设置之前，永不达到实际的内存不足状态。</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># replica-ignore-maxmemory yes</span><br><br><span class="hljs-comment">############################# LAZY FREEING 懒惰释放 ####################################</span><br><br><span class="hljs-comment"># Redis has two primitives to delete keys. One is called DEL and is a blocking</span><br><span class="hljs-comment"># deletion of the object. It means that the server stops processing new commands</span><br><span class="hljs-comment"># in order to reclaim all the memory associated with an object in a synchronous</span><br><span class="hljs-comment"># way. If the key deleted is associated with a small object, the time needed</span><br><span class="hljs-comment"># in order to execute the DEL command is very small and comparable to most other</span><br><span class="hljs-comment"># O(1) or O(log_N) commands in Redis. However if the key is associated with an</span><br><span class="hljs-comment"># aggregated value containing millions of elements, the server can block for</span><br><span class="hljs-comment"># a long time (even seconds) in order to complete the operation.</span><br><span class="hljs-comment"># Redis有两个删除键的原语。 一种称为DEL，它是对象的阻塞删除。 这意味着服务器停止处理新命令，</span><br><span class="hljs-comment"># 以便以同步方式回收与对象关联的所有内存。 如果删除的键与一个小对象相关联，</span><br><span class="hljs-comment"># 则执行DEL命令所需的时间非常短，可与大多数其他对象相比 Redis 中的 O（1）或 O（log_N）命令。 </span><br><span class="hljs-comment"># 但是，如果键与包含数百万个元素的聚合值关联，则服务器可能会阻塞很长时间（甚至几秒钟）以完成操作。</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># For the above reasons Redis also offers non blocking deletion primitives</span><br><span class="hljs-comment"># such as UNLINK (non blocking DEL) and the ASYNC option of FLUSHALL and</span><br><span class="hljs-comment"># FLUSHDB commands, in order to reclaim memory in background. Those commands</span><br><span class="hljs-comment"># are executed in constant time. Another thread will incrementally free the</span><br><span class="hljs-comment"># object in the background as fast as possible.</span><br><span class="hljs-comment"># 由于上述原因，Redis还提供了非阻塞删除原语，例如UNLINK（非阻塞DEL）以及FLUSHALL和FLUSHDB命令的</span><br><span class="hljs-comment"># ASYNC选项，以便在后台回收内存。 这些命令在固定时间内执行。 另一个线程将尽可能快地在后台逐渐释放对象。</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># DEL, UNLINK and ASYNC option of FLUSHALL and FLUSHDB are user-controlled.</span><br><span class="hljs-comment"># It&#x27;s up to the design of the application to understand when it is a good</span><br><span class="hljs-comment"># idea to use one or the other. However the Redis server sometimes has to</span><br><span class="hljs-comment"># delete keys or flush the whole database as a side effect of other operations.</span><br><span class="hljs-comment"># Specifically Redis deletes objects independently of a user call in the</span><br><span class="hljs-comment"># following scenarios:</span><br><span class="hljs-comment"># 用户可以控制FLUSHALL和FLUSHDB的DEL，UNLINK和ASYNC选项。 由应用程序的设计来决定何时使用</span><br><span class="hljs-comment"># 一个或另一个是一个好主意。 但是，Redis服务器有时必须删除键或刷新整个数据库，这是其他操作的副作用。 </span><br><span class="hljs-comment"># 特别是在以下情况下，Redis会独立于用户调用删除对象：</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># 1) On eviction, because of the maxmemory and maxmemory policy configurations,</span><br><span class="hljs-comment">#    in order to make room for new data, without going over the specified</span><br><span class="hljs-comment">#    memory limit.</span><br><span class="hljs-comment"># 在逐出时，由于maxmemory和maxmemory策略配置，为了在不超过指定的内存限制的情况下为新数据腾出空间。</span><br><span class="hljs-comment"># 2) Because of expire: when a key with an associated time to live (see the</span><br><span class="hljs-comment">#    EXPIRE command) must be deleted from memory.</span><br><span class="hljs-comment"># 由于过期：必须从内存中删除具有相关生存时间的 key（请参阅 EXPIRE 命令）。</span><br><span class="hljs-comment"># 3) Because of a side effect of a command that stores data on a key that may</span><br><span class="hljs-comment">#    already exist. For example the RENAME command may delete the old key</span><br><span class="hljs-comment">#    content when it is replaced with another one. Similarly SUNIONSTORE</span><br><span class="hljs-comment">#    or SORT with STORE option may delete existing keys. The SET command</span><br><span class="hljs-comment">#    itself removes any old content of the specified key in order to replace</span><br><span class="hljs-comment">#    it with the specified string.</span><br><span class="hljs-comment"># 由于将数据存储在可能已经存在的键上的命令的副作用。 例如，当 RENAME 命令被另一旧密钥内容替换时，</span><br><span class="hljs-comment"># 它可能会删除它。 同样，SUNIONSTORE 或S ORT with STORE 选项可能会删除现有密钥。 </span><br><span class="hljs-comment"># SET 命令本身会删除指定键的所有旧内容，以便将其替换为指定的字符串。</span><br><span class="hljs-comment"># 4) During replication, when a replica performs a full resynchronization with</span><br><span class="hljs-comment">#    its master, the content of the whole database is removed in order to</span><br><span class="hljs-comment">#    load the RDB file just transferred.</span><br><span class="hljs-comment"># 在复制期间，当副本与其主副本执行完全重新同步时，将删除整个数据库的内容，以便加载刚传输的 RDB 文件。</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># In all the above cases the default is to delete objects in a blocking way,</span><br><span class="hljs-comment"># like if DEL was called. However you can configure each case specifically</span><br><span class="hljs-comment"># in order to instead release memory in a non-blocking way like if UNLINK</span><br><span class="hljs-comment"># was called, using the following configuration directives:</span><br><span class="hljs-comment"># 在上述所有情况下，默认设置都是以阻塞方式删除对象，就像调用DEL一样。 但是，您可以专门配置每种情况，</span><br><span class="hljs-comment"># 以便使用以下配置指令以非阻塞方式释放内存，例如调用UNLINK的情况：</span><br><br>lazyfree-lazy-eviction no<br>lazyfree-lazy-expire no<br>lazyfree-lazy-server-del no<br>replica-lazy-flush no<br><br><span class="hljs-comment">############################## APPEND ONLY MODE AOF日志模式 ###############################</span><br><br><span class="hljs-comment"># By default Redis asynchronously dumps the dataset on disk. This mode is</span><br><span class="hljs-comment"># good enough in many applications, but an issue with the Redis process or</span><br><span class="hljs-comment"># a power outage may result into a few minutes of writes lost (depending on</span><br><span class="hljs-comment"># the configured save points).</span><br><span class="hljs-comment"># 默认情况下，Redis异步将数据集转储到磁盘上。 此模式在许多应用程序中已经足够好，</span><br><span class="hljs-comment"># 但是Redis进程问题或电源中断可能会导致几分钟的写入丢失（取决于配置的保存点）。</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># The Append Only File is an alternative persistence mode that provides</span><br><span class="hljs-comment"># much better durability. For instance using the default data fsync policy</span><br><span class="hljs-comment"># (see later in the config file) Redis can lose just one second of writes in a</span><br><span class="hljs-comment"># dramatic event like a server power outage, or a single write if something</span><br><span class="hljs-comment"># wrong with the Redis process itself happens, but the operating system is</span><br><span class="hljs-comment"># still running correctly.</span><br><span class="hljs-comment"># 仅附加文件是一种替代的持久性模式，可提供更好的持久性。 例如，使用默认数据fsync策略（请参阅配置文件中的稍后内容），Redis可能在服务器断电等严重事件中丢失一秒钟的写入，如果Redis进程本身发生错误，则一次写入将丢失一次，但是 操作系统仍在正常运行。</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># AOF and RDB persistence can be enabled at the same time without problems.</span><br><span class="hljs-comment"># If the AOF is enabled on startup Redis will load the AOF, that is the file</span><br><span class="hljs-comment"># with the better durability guarantees.</span><br><span class="hljs-comment"># 可以同时启用AOF和RDB持久性，而不会出现问题。 如果在启动时启用了AOF，则Redis将加载AOF，</span><br><span class="hljs-comment"># 即该文件具有更好的持久性保证。</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># Please check http://redis.io/topics/persistence for more information.</span><br><br>appendonly no<br><br><span class="hljs-comment"># The name of the append only file (default: &quot;appendonly.aof&quot;)</span><br><br>appendfilename <span class="hljs-string">&quot;appendonly.aof&quot;</span><br><br><span class="hljs-comment"># The fsync() call tells the Operating System to actually write data on disk</span><br><span class="hljs-comment"># instead of waiting for more data in the output buffer. Some OS will really flush</span><br><span class="hljs-comment"># data on disk, some other OS will just try to do it ASAP.</span><br><span class="hljs-comment"># fsync()调用告诉操作系统将数据实际写在磁盘上，而不是等待输出缓冲区中的更多数据。 有些操作系统确实会刷新磁盘上的数据，而另一些操作系统只会尝试尽快完成该操作。</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># Redis supports three different modes:</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># no: don&#x27;t fsync, just let the OS flush the data when it wants. Faster.</span><br><span class="hljs-comment">#			不要fsync，只要让OS在需要时刷新数据即可。快。</span><br><span class="hljs-comment"># always: fsync after every write to the append only log. Slow, Safest.</span><br><span class="hljs-comment">#			每次写入 AOF 后 fsync。慢，安全</span><br><span class="hljs-comment"># everysec: fsync only one time every second. Compromise.</span><br><span class="hljs-comment">#			每秒仅同步一次fsync。 妥协。</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># The default is &quot;everysec&quot;, as that&#x27;s usually the right compromise between</span><br><span class="hljs-comment"># speed and data safety. It&#x27;s up to you to understand if you can relax this to</span><br><span class="hljs-comment"># &quot;no&quot; that will let the operating system flush the output buffer when</span><br><span class="hljs-comment"># it wants, for better performances (but if you can live with the idea of</span><br><span class="hljs-comment"># some data loss consider the default persistence mode that&#x27;s snapshotting),</span><br><span class="hljs-comment"># or on the contrary, use &quot;always&quot; that&#x27;s very slow but a bit safer than</span><br><span class="hljs-comment"># everysec.</span><br><span class="hljs-comment"># 默认值为“ everysec”，因为这通常是速度和数据安全性之间的正确折衷。 您可以了解是否可以将其放宽为“ no”，</span><br><span class="hljs-comment"># 以便操作系统在需要时刷新输出缓冲区，以获得更好的性能（但是如果您可以忍受某些数据丢失的想法，</span><br><span class="hljs-comment"># 请考虑使用默认的持久模式 （即快照），或者相反，请使用“总是”，该速度非常慢，但比 everysec 更安全。</span><br><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># More details please check the following article:</span><br><span class="hljs-comment"># http://antirez.com/post/redis-persistence-demystified.html</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># If unsure, use &quot;everysec&quot;.</span><br><br><span class="hljs-comment"># appendfsync always</span><br>appendfsync everysec<br><span class="hljs-comment"># appendfsync no</span><br><br><span class="hljs-comment"># When the AOF fsync policy is set to always or everysec, and a background</span><br><span class="hljs-comment"># saving process (a background save or AOF log background rewriting) is</span><br><span class="hljs-comment"># performing a lot of I/O against the disk, in some Linux configurations</span><br><span class="hljs-comment"># Redis may block too long on the fsync() call. Note that there is no fix for</span><br><span class="hljs-comment"># this currently, as even performing fsync in a different thread will block</span><br><span class="hljs-comment"># our synchronous write(2) call.</span><br><span class="hljs-comment"># 当AOF fsync 策略设置为 always 或 everysec，并且后台保存进程（后台保存或 AOF 日志后台重写）对磁盘执行大量I / O时，在某些Linux配置中，Redis fsync() 调用可能会在磁盘上阻塞太长时间。 请注意，目前尚无此修复程序，因为即使在其他线程中执行 fsync 也将阻止我们的同步 write（2）调用。</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># In order to mitigate this problem it&#x27;s possible to use the following option</span><br><span class="hljs-comment"># that will prevent fsync() from being called in the main process while a</span><br><span class="hljs-comment"># BGSAVE or BGREWRITEAOF is in progress.</span><br><span class="hljs-comment"># 为了缓解此问题，可以使用以下选项来防止在 BGSAVE 或 BGREWRITEAOF 进行时在主进程中调用 fsync()。</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># This means that while another child is saving, the durability of Redis is</span><br><span class="hljs-comment"># the same as &quot;appendfsync none&quot;. In practical terms, this means that it is</span><br><span class="hljs-comment"># possible to lose up to 30 seconds of log in the worst scenario (with the</span><br><span class="hljs-comment"># default Linux settings).</span><br><span class="hljs-comment"># 这意味着当另一个孩子正在保存时，Redis 的持久性与“ appendfsync none”相同。 实际上，</span><br><span class="hljs-comment"># 这意味着在最坏的情况下（使用默认的 Linux 设置）可能会丢失多达 30 秒的日志。</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># If you have latency problems turn this to &quot;yes&quot;. Otherwise leave it as</span><br><span class="hljs-comment"># &quot;no&quot; that is the safest pick from the point of view of durability.</span><br><span class="hljs-comment">#  如果您有延迟问题，请将其设置为“是”。 否则将其保留为,从耐用性的角度来看，“ no”是最安全的选择。</span><br><br>no-appendfsync-on-rewrite no<br><br><span class="hljs-comment"># Automatic rewrite of the append only file.（自动重写 AOF。）</span><br><span class="hljs-comment"># Redis is able to automatically rewrite the log file implicitly calling</span><br><span class="hljs-comment"># BGREWRITEAOF when the AOF log size grows by the specified percentage.</span><br><span class="hljs-comment"># 当AOF日志大小增加指定的百分比时，Redis可以隐式调用 BGREWRITEAOF 自动重写日志文件。</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># This is how it works: Redis remembers the size of the AOF file after the</span><br><span class="hljs-comment"># latest rewrite (if no rewrite has happened since the restart, the size of</span><br><span class="hljs-comment"># the AOF at startup is used).</span><br><span class="hljs-comment"># 它是这样工作的：Redis会在最近一次重写后记住AOF文件的大小（如果自重新启动以来未发生任何重写，则使用启动时AOF的大小）。</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># This base size is compared to the current size. If the current size is</span><br><span class="hljs-comment"># bigger than the specified percentage, the rewrite is triggered. Also</span><br><span class="hljs-comment"># you need to specify a minimal size for the AOF file to be rewritten, this</span><br><span class="hljs-comment"># is useful to avoid rewriting the AOF file even if the percentage increase</span><br><span class="hljs-comment"># is reached but it is still pretty small.</span><br><span class="hljs-comment"># 将此基本大小与当前大小进行比较。 如果当前大小大于指定的百分比，则触发重写。 </span><br><span class="hljs-comment"># 另外，您需要指定要重写的AOF文件的最小大小，这对于避免重写AOF文件非常有用，</span><br><span class="hljs-comment"># 即使达到百分比增加，但它仍然很小。</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># Specify a percentage of zero in order to disable the automatic AOF</span><br><span class="hljs-comment"># rewrite feature.   </span><br><span class="hljs-comment"># 指定零百分比以禁用自动AOF重写功能。</span><br><br>auto-aof-rewrite-percentage 100<br>auto-aof-rewrite-min-size 64mb<br><br><span class="hljs-comment"># An AOF file may be found to be truncated at the end during the Redis</span><br><span class="hljs-comment"># startup process, when the AOF data gets loaded back into memory.</span><br><span class="hljs-comment"># This may happen when the system where Redis is running</span><br><span class="hljs-comment"># crashes, especially when an ext4 filesystem is mounted without the</span><br><span class="hljs-comment"># data=ordered option (however this can&#x27;t happen when Redis itself</span><br><span class="hljs-comment"># crashes or aborts but the operating system still works correctly).</span><br><span class="hljs-comment"># AOF 文件可能在尾部是不完整的，当 Redis 启动的时候，AOF文件的数据被载入内存。重启可能发生在redis所在的主机操作系统宕机后，尤其在ext4文件系统没有加上data=ordered选项（redis宕机或者异常终止不会造成尾部不完整现象。）出现这种现象，可以选择让redis退出，或者导入尽可能多的数据。</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># Redis can either exit with an error when this happens, or load as much</span><br><span class="hljs-comment"># data as possible (the default now) and start if the AOF file is found</span><br><span class="hljs-comment"># to be truncated at the end. The following option controls this behavior.</span><br><span class="hljs-comment"># 发生这种情况时，Redis 可能会退出并显示错误，也可以在发现 AOF 文件最后被截断后，加载尽可能多的数据（当前为默认值）。以下选项控制此行为。</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># If aof-load-truncated is set to yes, a truncated AOF file is loaded and</span><br><span class="hljs-comment"># the Redis server starts emitting a log to inform the user of the event.</span><br><span class="hljs-comment"># Otherwise if the option is set to no, the server aborts with an error</span><br><span class="hljs-comment"># and refuses to start. When the option is set to no, the user requires</span><br><span class="hljs-comment"># to fix the AOF file using the &quot;redis-check-aof&quot; utility before to restart</span><br><span class="hljs-comment"># the server.</span><br><span class="hljs-comment"># 如果 aof-load-truncated 设置为 yes，则将加载截短的 AOF 文件，并且 Redis 服务器将开始</span><br><span class="hljs-comment"># 发出日志以将事件通知用户。否则，如果该选项设置为 no，则服务器将中止并显示错误，并拒绝启动。</span><br><span class="hljs-comment"># 如果将该选项设置为 no，则用户需要在重新启动服务器之前使用“ redis-check-aof”修复 AOF 文件。</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># Note that if the AOF file will be found to be corrupted in the middle</span><br><span class="hljs-comment"># the server will still exit with an error. This option only applies when</span><br><span class="hljs-comment"># Redis will try to read more data from the AOF file but not enough bytes</span><br><span class="hljs-comment"># will be found.</span><br><span class="hljs-comment"># 请注意，如果在中间发现 AOF 文件已损坏，则服务器仍将退出并出现错误。 仅当 Redis 尝试从 AOF </span><br><span class="hljs-comment"># 文件读取更多数据但找不到足够的字节时，此选项才适用。</span><br><br>aof-load-truncated yes<br><br><span class="hljs-comment"># When rewriting the AOF file, Redis is able to use an RDB preamble in the</span><br><span class="hljs-comment"># AOF file for faster rewrites and recoveries. When this option is turned</span><br><span class="hljs-comment"># on the rewritten AOF file is composed of two different stanzas:</span><br><span class="hljs-comment"># 重写AOF文件时，Redis可以使用AOF文件中的RDB前同步码来更快地进行重写和恢复。 启用此选项后，重写的AOF文件由两个不同的节组成：</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment">#   [RDB file][AOF tail]</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># When loading Redis recognizes that the AOF file starts with the &quot;REDIS&quot;</span><br><span class="hljs-comment"># string and loads the prefixed RDB file, and continues loading the AOF</span><br><span class="hljs-comment"># tail.</span><br><span class="hljs-comment"># 加载时，Redis会识别AOF文件以“ REDIS”字符串开头并加载带前缀的RDB文件，然后继续加载AOF尾部。</span><br>aof-use-rdb-preamble yes<br><br><span class="hljs-comment">################################ LUA SCRIPTING LUA脚本  ###############################</span><br><br><span class="hljs-comment"># Max execution time of a Lua script in milliseconds.（Lua脚本的最大执行时间（以毫秒为单位）。）</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># If the maximum execution time is reached Redis will log that a script is</span><br><span class="hljs-comment"># still in execution after the maximum allowed time and will start to</span><br><span class="hljs-comment"># reply to queries with an error.</span><br><span class="hljs-comment"># 如果达到了最大执行时间，Redis将记录在允许的最大时间后脚本仍在执行中，并将开始以错误答复查询。</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># When a long running script exceeds the maximum execution time only the</span><br><span class="hljs-comment"># SCRIPT KILL and SHUTDOWN NOSAVE commands are available. The first can be</span><br><span class="hljs-comment"># used to stop a script that did not yet called write commands. The second</span><br><span class="hljs-comment"># is the only way to shut down the server in the case a write command was</span><br><span class="hljs-comment"># already issued by the script but the user doesn&#x27;t want to wait for the natural</span><br><span class="hljs-comment"># termination of the script.</span><br><span class="hljs-comment"># 如果长时间运行的脚本超过了最大执行时间，则只有“ SCRIPT KILL”和“ SHUTDOWN NOSAVE”命令可用。第一个可用于停止尚未调用写命令的脚本。 第二种是在脚本已发出写命令但用户不想等待脚本自然终止的情况下关闭服务器的唯一方法。</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># Set it to 0 or a negative value for unlimited execution without warnings.</span><br><span class="hljs-comment"># 将其设置为0或负值可无警告地无限执行。</span><br>lua-time-limit 5000<br><br><span class="hljs-comment">################################ REDIS CLUSTER REDIS集群 ##############################</span><br><br><span class="hljs-comment"># Normal Redis instances can&#x27;t be part of a Redis Cluster; only nodes that are</span><br><span class="hljs-comment"># started as cluster nodes can. In order to start a Redis instance as a</span><br><span class="hljs-comment"># cluster node enable the cluster support uncommenting the following:</span><br><span class="hljs-comment"># 普通Redis实例不能属于Redis集群；只有作为群集节点启动的节点可以。为了将 Redis 实例作为群集节点启动，请在不注释以下内容的情况下启用群集支持：</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># cluster-enabled yes</span><br><br><span class="hljs-comment"># Every cluster node has a cluster configuration file. This file is not</span><br><span class="hljs-comment"># intended to be edited by hand. It is created and updated by Redis nodes.</span><br><span class="hljs-comment"># Every Redis Cluster node requires a different cluster configuration file.</span><br><span class="hljs-comment"># Make sure that instances running in the same system do not have</span><br><span class="hljs-comment"># overlapping cluster configuration file names.</span><br><span class="hljs-comment"># 每个群集节点都有一个群集配置文件。 该文件不适合手工编辑。 它由Redis节点创建和更新。 每个Redis群集节点都需要一个不同的群集配置文件。 确保在同一系统上运行的实例没有重叠的集群配置文件名。</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># cluster-config-file nodes-6379.conf</span><br><br><span class="hljs-comment"># Cluster node timeout is the amount of milliseconds a node must be unreachable</span><br><span class="hljs-comment"># for it to be considered in failure state.</span><br><span class="hljs-comment"># Most other internal time limits are multiple of the node timeout.</span><br><span class="hljs-comment"># 群集节点超时是一个节点必须不可达的毫秒数，才能将其视为故障状态。 </span><br><span class="hljs-comment"># 其他大多数内部时间限制是节点超时的倍数。</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># cluster-node-timeout 15000</span><br><br><span class="hljs-comment"># A replica of a failing master will avoid to start a failover if its data</span><br><span class="hljs-comment"># looks too old.</span><br><span class="hljs-comment"># 如果发生故障的主副本的数据看起来太旧，它将避免启动故障转移。</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># There is no simple way for a replica to actually have an exact measure of</span><br><span class="hljs-comment"># its &quot;data age&quot;, so the following two checks are performed:</span><br><span class="hljs-comment"># 没有一种简单的方法可以使副本实际上具有其“数据年龄”的准确度量，因此执行以下两项检查：</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># 1) If there are multiple replicas able to failover, they exchange messages</span><br><span class="hljs-comment">#    in order to try to give an advantage to the replica with the best</span><br><span class="hljs-comment">#    replication offset (more data from the master processed).</span><br><span class="hljs-comment">#    Replicas will try to get their rank by offset, and apply to the start</span><br><span class="hljs-comment">#    of the failover a delay proportional to their rank.</span><br><span class="hljs-comment"># 如果存在多个能够进行故障转移的副本，则它们会交换消息，以便尝试利用具有最佳复制偏移量（处理了更多来自主数据库的数据）的副本来获得优势。 副本将尝试按偏移量获取其等级，并将与它们的等级成比例的延迟应用于故障转移。</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># 2) Every single replica computes the time of the last interaction with</span><br><span class="hljs-comment">#    its master. This can be the last ping or command received (if the master</span><br><span class="hljs-comment">#    is still in the &quot;connected&quot; state), or the time that elapsed since the</span><br><span class="hljs-comment">#    disconnection with the master (if the replication link is currently down).</span><br><span class="hljs-comment">#    If the last interaction is too old, the replica will not try to failover</span><br><span class="hljs-comment">#    at all.</span><br><span class="hljs-comment"># 每个单个副本都会计算与其母版之间最后一次交互的时间。 这可以是最后收到的ping或命令（如果主服务器仍处于“已连接”状态），也可以是自从与主服务器断开连接以来经过的时间（如果复制链接当前已断开）。如果最后一次交互也是 旧版本，副本将完全不会尝试故障转移。</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># The point &quot;2&quot; can be tuned by user. Specifically a replica will not perform</span><br><span class="hljs-comment"># the failover if, since the last interaction with the master, the time</span><br><span class="hljs-comment"># elapsed is greater than:</span><br><span class="hljs-comment"># 用户可以调整点“ 2”。 具体而言，如果自从上次与主服务器进行交互以来，经过的时间大于以下时间，则副本将不执行故障转移：</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment">#   (node-timeout * replica-validity-factor) + repl-ping-replica-period</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># So for example if node-timeout is 30 seconds, and the replica-validity-factor</span><br><span class="hljs-comment"># is 10, and assuming a default repl-ping-replica-period of 10 seconds, the</span><br><span class="hljs-comment"># replica will not try to failover if it was not able to talk with the master</span><br><span class="hljs-comment"># for longer than 310 seconds.</span><br><span class="hljs-comment"># 因此，例如，如果节点超时（node-timeout）为30秒，并且副本有效性因子（replica-validity-factor）为10，并且假设默认的 repl-ping-replica-period 值为10秒，即如果超过 310 秒副本将不会尝试进行故障转移。</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># A large replica-validity-factor may allow replicas with too old data to failover</span><br><span class="hljs-comment"># a master, while a too small value may prevent the cluster from being able to</span><br><span class="hljs-comment"># elect a replica at all.</span><br><span class="hljs-comment"># 较大的 replica-validity-factor 可能会使数据过旧的副本无法对主副本进行故障转移，而值太小则可能会使群集根本无法选择副本。</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># For maximum availability, it is possible to set the replica-validity-factor</span><br><span class="hljs-comment"># to a value of 0, which means, that replicas will always try to failover the</span><br><span class="hljs-comment"># master regardless of the last time they interacted with the master.</span><br><span class="hljs-comment"># (However they&#x27;ll always try to apply a delay proportional to their</span><br><span class="hljs-comment"># offset rank).</span><br><span class="hljs-comment"># 为了获得最大可用性，可以将副本有效性因子设置为 0，这意味着，无论副本上次与主服务器进行交互时，副本将始终尝试对主服务器进行故障转移。（但是，他们将始终尝试应用与其偏移等级成正比的延迟）。</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># Zero is the only value able to guarantee that when all the partitions heal</span><br><span class="hljs-comment"># the cluster will always be able to continue.</span><br><span class="hljs-comment"># 零是唯一能够保证当所有分区恢复正常后群集将始终能够继续运行的值。</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># cluster-replica-validity-factor 10</span><br><br><span class="hljs-comment"># Cluster replicas are able to migrate to orphaned masters, that are masters</span><br><span class="hljs-comment"># that are left without working replicas. This improves the cluster ability</span><br><span class="hljs-comment"># to resist to failures as otherwise an orphaned master can&#x27;t be failed over</span><br><span class="hljs-comment"># in case of failure if it has no working replicas.</span><br><span class="hljs-comment"># 群集副本能够迁移到孤立的主数据库，即那些没有工作副本的主数据库。这样可以提高群集抵御故障的能力，因为如果孤立的主节点没有可用的副本，则该主节点在发生故障的情况下也无法进行故障转移。</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># Replicas migrate to orphaned masters only if there are still at least a</span><br><span class="hljs-comment"># given number of other working replicas for their old master. This number</span><br><span class="hljs-comment"># is the &quot;migration barrier&quot;. A migration barrier of 1 means that a replica</span><br><span class="hljs-comment"># will migrate only if there is at least 1 other working replica for its master</span><br><span class="hljs-comment"># and so forth. It usually reflects the number of replicas you want for every</span><br><span class="hljs-comment"># master in your cluster.</span><br><span class="hljs-comment"># 仅当旧的主副本仍存在至少给定数量的其他工作副本时，从副本才会迁移到孤立的主副本。这个数字是“移民壁垒”。 迁移障碍为 1 表示仅当副本数据库的主副本上至少有 1 个其他工作副本时，副本副本才会迁移。它通常反映出集群中每个主数据库所需的副本数。</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># Default is 1 (replicas migrate only if their masters remain with at least</span><br><span class="hljs-comment"># one replica). To disable migration just set it to a very large value.</span><br><span class="hljs-comment"># A value of 0 can be set but is useful only for debugging and dangerous</span><br><span class="hljs-comment"># in production.</span><br><span class="hljs-comment"># 默认值为 1（仅当其主副本保留至少一个从副本时，从副本才会迁移）。要禁用迁移，只需将其设置为非常大的值即可。可以将值设置为 0，但仅用于调试和生产危险。</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># cluster-migration-barrier 1</span><br><br><span class="hljs-comment"># By default Redis Cluster nodes stop accepting queries if they detect there</span><br><span class="hljs-comment"># is at least an hash slot uncovered (no available node is serving it).</span><br><span class="hljs-comment"># This way if the cluster is partially down (for example a range of hash slots</span><br><span class="hljs-comment"># are no longer covered) all the cluster becomes, eventually, unavailable.</span><br><span class="hljs-comment"># It automatically returns available as soon as all the slots are covered again.</span><br><span class="hljs-comment"># 默认情况下，如果 Redis 集群节点检测到至少发现一个哈希槽（没有可用的节点正在为其提供服务），它们将停止接受查询。这样如果集群部分关闭（例如，不再覆盖哈希槽的范围），则所有集群最终将变得不可用。再次覆盖所有插槽后，它将自动返回可用状态。</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># However sometimes you want the subset of the cluster which is working,</span><br><span class="hljs-comment"># to continue to accept queries for the part of the key space that is still</span><br><span class="hljs-comment"># covered. In order to do so, just set the cluster-require-full-coverage</span><br><span class="hljs-comment"># option to no.</span><br><span class="hljs-comment">#  但是有时您希望正在运行的群集子集继续接受对仍覆盖的部分键空间的查询。为此只需将 cluster-require-full-coverage 选项设置为 no。</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># cluster-require-full-coverage yes</span><br><br><span class="hljs-comment"># This option, when set to yes, prevents replicas from trying to failover its</span><br><span class="hljs-comment"># master during master failures. However the master can still perform a</span><br><span class="hljs-comment"># manual failover, if forced to do so.</span><br><span class="hljs-comment"># 设置为 yes 时，此选项可防止副本在主服务器发生故障时尝试对其主服务器进行故障转移。但是，主服务器仍然可以执行手动故障转移（如果被迫执行）。</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># This is useful in different scenarios, especially in the case of multiple</span><br><span class="hljs-comment"># data center operations, where we want one side to never be promoted if not</span><br><span class="hljs-comment"># in the case of a total DC failure.</span><br><span class="hljs-comment">#  这在不同的情况下很有用，特别是在多个数据中心操作的情况下，如果我们希望在完全 DC 故障的情况下不对一侧进行升级，那么这是不希望的。</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># cluster-replica-no-failover no</span><br><br><span class="hljs-comment"># In order to setup your cluster make sure to read the documentation</span><br><span class="hljs-comment"># available at http://redis.io web site.</span><br><br><span class="hljs-comment">########################## CLUSTER DOCKER/NAT support 集群DOCKER / NAT支持  ########################</span><br><br><span class="hljs-comment"># In certain deployments, Redis Cluster nodes address discovery fails, because</span><br><span class="hljs-comment"># addresses are NAT-ted or because ports are forwarded (the typical case is</span><br><span class="hljs-comment"># Docker and other containers).</span><br><span class="hljs-comment"># 在某些部署中，Redis 集群节点的地址发现失败，这是因为地址经过 NAT 限制或端口被转发（典型情况是 Docker 和其他容器）。</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># In order to make Redis Cluster working in such environments, a static</span><br><span class="hljs-comment"># configuration where each node knows its public address is needed. The</span><br><span class="hljs-comment"># following two options are used for this scope, and are:</span><br><span class="hljs-comment">#  为了使Redis 集群在这样的环境中工作，需要一个静态配置，其中每个节点都知道其公共地址。以下两个选项用于此范围，分别是：</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># * cluster-announce-ip			# 群集公告IP</span><br><span class="hljs-comment"># * cluster-announce-port		# 群集公告端口</span><br><span class="hljs-comment"># * cluster-announce-bus-port	# 群集公告总线端口</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># Each instruct the node about its address, client port, and cluster message</span><br><span class="hljs-comment"># bus port. The information is then published in the header of the bus packets</span><br><span class="hljs-comment"># so that other nodes will be able to correctly map the address of the node</span><br><span class="hljs-comment"># publishing the information.</span><br><span class="hljs-comment"># 每一个都向节点指示其地址，客户端端口和集群消息总线端口。然后将信息发布在总线数据包的标头中，以便其他节点将能够正确映射发布信息的节点的地址。</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># If the above options are not used, the normal Redis Cluster auto-detection</span><br><span class="hljs-comment"># will be used instead. 如果不使用上述选项，则将使用常规的Redis群集自动检测。</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># Note that when remapped, the bus port may not be at the fixed offset of</span><br><span class="hljs-comment"># clients port + 10000, so you can specify any port and bus-port depending</span><br><span class="hljs-comment"># on how they get remapped. If the bus-port is not set, a fixed offset of</span><br><span class="hljs-comment"># 10000 will be used as usually.</span><br><span class="hljs-comment"># 请注意，重新映射时，总线端口可能不在客户端端口 + 10000的固定偏移处，因此您可以根据重新映射的方式指定任何端口和总线端口。如果未设置总线端口，通常将使用 10000 的固定偏移量。</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># Example:</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># cluster-announce-ip 10.1.1.5</span><br><span class="hljs-comment"># cluster-announce-port 6379</span><br><span class="hljs-comment"># cluster-announce-bus-port 6380</span><br><br><span class="hljs-comment">################################## SLOW LOG 慢日志 ###################################</span><br><br><span class="hljs-comment"># The Redis Slow Log is a system to log queries that exceeded a specified</span><br><span class="hljs-comment"># execution time. The execution time does not include the I/O operations</span><br><span class="hljs-comment"># like talking with the client, sending the reply and so forth,</span><br><span class="hljs-comment"># but just the time needed to actually execute the command (this is the only</span><br><span class="hljs-comment"># stage of command execution where the thread is blocked and can not serve</span><br><span class="hljs-comment"># other requests in the meantime).</span><br><span class="hljs-comment"># Redis Slow Log 是一个用于记录超过指定执行时间的查询的系统。执行时间不包括与客户端交谈，发送回复等I / O操作，而是实际执行命令所需的时间（这是命令执行的唯一阶段，在该阶段线程被阻塞并且可以在此期间不满足其他要求）。</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># You can configure the slow log with two parameters: one tells Redis</span><br><span class="hljs-comment"># what is the execution time, in microseconds, to exceed in order for the</span><br><span class="hljs-comment"># command to get logged, and the other parameter is the length of the</span><br><span class="hljs-comment"># slow log. When a new command is logged the oldest one is removed from the</span><br><span class="hljs-comment"># queue of logged commands.</span><br><span class="hljs-comment"># 您可以使用以下两个参数配置慢速日志：一个告诉 Redis 为了使命令被记录而超过执行时间（以微秒为单位），另一个参数是慢速日志的长度。记录新命令时，最旧的命令将从记录的命令队列中删除。</span><br><br><span class="hljs-comment"># The following time is expressed in microseconds, so 1000000 is equivalent</span><br><span class="hljs-comment"># to one second. Note that a negative number disables the slow log, while</span><br><span class="hljs-comment"># a value of zero forces the logging of every command.</span><br><span class="hljs-comment"># 以下时间以微秒表示，因此 1000000 等于一秒。请注意，负数将禁用慢速日志记录，而零值将强制记录每个命令。</span><br>slowlog-log-slower-than 10000<br><br><span class="hljs-comment"># There is no limit to this length. Just be aware that it will consume memory.</span><br><span class="hljs-comment"># You can reclaim memory used by the slow log with SLOWLOG RESET.</span><br><span class="hljs-comment"># 慢查询日志长度。当一个新的命令被写进日志的时候，最老的那个记录会被删掉。这个长度没有限制。只要有足够的内存就行。你可以通过 SLOWLOG RESET 来释放内存。</span><br>slowlog-max-len 128<br><br><span class="hljs-comment">################################ LATENCY MONITOR 延迟监视器 ##############################</span><br><br><span class="hljs-comment"># The Redis latency monitoring subsystem samples different operations</span><br><span class="hljs-comment"># at runtime in order to collect data related to possible sources of</span><br><span class="hljs-comment"># latency of a Redis instance.</span><br><span class="hljs-comment"># Redis 延迟监视子系统会在运行时对不同的操作进行采样，以收集与 Redis 实例的潜在延迟源相关的数据。</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># Via the LATENCY command this information is available to the user that can</span><br><span class="hljs-comment"># print graphs and obtain reports. 通过 LATENCY 命令，该信息可以打印图形并获取报告。</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># The system only logs operations that were performed in a time equal or</span><br><span class="hljs-comment"># greater than the amount of milliseconds specified via the</span><br><span class="hljs-comment"># latency-monitor-threshold configuration directive. When its value is set</span><br><span class="hljs-comment"># to zero, the latency monitor is turned off.</span><br><span class="hljs-comment"># 系统仅记录在等于或大于通过 delay-monitor-threshold 配置指令指定的毫秒量的时间内执行的操作。当其值设置为零时，等待时间监视器将关闭。</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># By default latency monitoring is disabled since it is mostly not needed</span><br><span class="hljs-comment"># if you don&#x27;t have latency issues, and collecting data has a performance</span><br><span class="hljs-comment"># impact, that while very small, can be measured under big load. Latency</span><br><span class="hljs-comment"># monitoring can easily be enabled at runtime using the command</span><br><span class="hljs-comment"># &quot;CONFIG SET latency-monitor-threshold &lt;milliseconds&gt;&quot; if needed.</span><br><span class="hljs-comment"># 默认情况下，延迟监视是禁用的，因为如果您没有延迟问题，则通常不需要监视，并且收集数据会对性能产生影响，尽管影响很小，但是可以在大负载下进行测量。 如果需要，可以在运行时使用命令“ CONFIG SET delay-monitor-threshold &lt;milliseconds&gt;”轻松启用延迟监视。</span><br>latency-monitor-threshold 0<br><br><span class="hljs-comment">############################# EVENT NOTIFICATION 活动通知 ##############################</span><br><br><span class="hljs-comment"># Redis can notify Pub/Sub clients about events happening in the key space.</span><br><span class="hljs-comment"># Redis 可以通知发布/订阅客户端有关 key 空间中发生的事件。</span><br><span class="hljs-comment"># This feature is documented at http://redis.io/topics/notifications</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># For instance if keyspace events notification is enabled, and a client</span><br><span class="hljs-comment"># performs a DEL operation on key &quot;foo&quot; stored in the Database 0, two</span><br><span class="hljs-comment"># messages will be published via Pub/Sub:</span><br><span class="hljs-comment"># 例如，如果启用了键空间事件通知，并且客户端对存储在数据库0中的键“ foo”执行了DEL操作，则将通过Pub / Sub发布两条消息：</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># PUBLISH __keyspace@0__:foo del</span><br><span class="hljs-comment"># PUBLISH __keyevent@0__:del foo</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># It is possible to select the events that Redis will notify among a set</span><br><span class="hljs-comment"># of classes. Every class is identified by a single character:</span><br><span class="hljs-comment"># 可以在一组类中选择Redis将通知的事件。 每个类都由一个字符标识：</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment">#  K     Keyspace events, published with __keyspace@&lt;db&gt;__ prefix.</span><br><span class="hljs-comment">#  E     Keyevent events, published with __keyevent@&lt;db&gt;__ prefix.</span><br><span class="hljs-comment">#  g     Generic commands (non-type specific) like DEL, EXPIRE, RENAME, ...</span><br><span class="hljs-comment">#  $     String commands</span><br><span class="hljs-comment">#  l     List commands</span><br><span class="hljs-comment">#  s     Set commands</span><br><span class="hljs-comment">#  h     Hash commands</span><br><span class="hljs-comment">#  z     Sorted set commands</span><br><span class="hljs-comment">#  x     Expired events (events generated every time a key expires)</span><br><span class="hljs-comment">#  e     Evicted events (events generated when a key is evicted for maxmemory)</span><br><span class="hljs-comment">#  A     Alias for g$lshzxe, so that the &quot;AKE&quot; string means all the events.</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment">#  The &quot;notify-keyspace-events&quot; takes as argument a string that is composed</span><br><span class="hljs-comment">#  of zero or multiple characters. The empty string means that notifications</span><br><span class="hljs-comment">#  are disabled.</span><br><span class="hljs-comment"># “notify-keyspace-events”将由零个或多个字符组成的字符串作为参数。 空字符串表示已禁用通知。</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment">#  Example: to enable list and generic events, from the point of view of the</span><br><span class="hljs-comment">#           event name, use: 从事件名称的角度来看，要启用列表事件和通用事件，请使用：</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment">#  notify-keyspace-events Elg</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment">#  Example 2: to get the stream of the expired keys subscribing to channel</span><br><span class="hljs-comment">#             name __keyevent@0__:expired use: 获取订阅频道名称__keyevent @0__的过期 keys 流：过期使用：</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment">#  notify-keyspace-events Ex</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment">#  By default all notifications are disabled because most users don&#x27;t need</span><br><span class="hljs-comment">#  this feature and the feature has some overhead. Note that if you don&#x27;t</span><br><span class="hljs-comment">#  specify at least one of K or E, no events will be delivered.</span><br><span class="hljs-comment"># 默认情况下，所有通知都被禁用，因为大多数用户不需要此功能，并且该功能有一些开销。 请注意，如果您未指定K或E中的至少一个，则不会传递任何事件。</span><br>notify-keyspace-events <span class="hljs-string">&quot;&quot;</span><br><br><span class="hljs-comment">############################### ADVANCED CONFIG ###############################</span><br><br><span class="hljs-comment"># Hashes are encoded using a memory efficient data structure when they have a</span><br><span class="hljs-comment"># small number of entries, and the biggest entry does not exceed a given</span><br><span class="hljs-comment"># threshold. These thresholds can be configured using the following directives.</span><br><span class="hljs-comment"># 当哈希条目只有少量条目且最大条目没有超过给定阈值时，将使用内存高效的数据结构对其进行编码。 可以使用以下指令配置这些阈值。</span><br>hash-max-ziplist-entries 512<br>hash-max-ziplist-value 64<br><br><span class="hljs-comment"># Lists are also encoded in a special way to save a lot of space.</span><br><span class="hljs-comment"># The number of entries allowed per internal list node can be specified</span><br><span class="hljs-comment"># as a fixed maximum size or a maximum number of elements.</span><br><span class="hljs-comment"># 列表也以特殊方式编码，以节省大量空间。 每个内部列表节点允许的条目数可以指定为固定的最大大小或最大元素数。</span><br><span class="hljs-comment"># For a fixed maximum size, use -5 through -1, meaning:</span><br><span class="hljs-comment"># -5: max size: 64 Kb  &lt;-- not recommended for normal workloads</span><br><span class="hljs-comment"># -4: max size: 32 Kb  &lt;-- not recommended</span><br><span class="hljs-comment"># -3: max size: 16 Kb  &lt;-- probably not recommended</span><br><span class="hljs-comment"># -2: max size: 8 Kb   &lt;-- good</span><br><span class="hljs-comment"># -1: max size: 4 Kb   &lt;-- good</span><br><span class="hljs-comment"># Positive numbers mean store up to _exactly_ that number of elements</span><br><span class="hljs-comment"># per list node. 正数表示每个列表节点最多可以存储该数量的元素。</span><br><span class="hljs-comment"># The highest performing option is usually -2 (8 Kb size) or -1 (4 Kb size),</span><br><span class="hljs-comment"># but if your use case is unique, adjust the settings as necessary.</span><br><span class="hljs-comment"># 性能最高的选项通常是-2（8 Kb大小）或-1（4 Kb大小），但是如果您的用例是唯一的，请根据需要调整设置。</span><br>list-max-ziplist-size -2<br><br><span class="hljs-comment"># Lists may also be compressed.</span><br><span class="hljs-comment"># Compress depth is the number of quicklist ziplist nodes from *each* side of</span><br><span class="hljs-comment"># the list to *exclude* from compression.  The head and tail of the list</span><br><span class="hljs-comment"># are always uncompressed for fast push/pop operations.  Settings are:</span><br><span class="hljs-comment"># 列表也可以被压缩。 压缩深度是指从列表的*每个*一侧到*从压缩中排除*的快速列表 ziplist 节点的数量。 列表的开头和结尾始终是未压缩的，以便快速进行推入/弹出操作。 设置为：</span><br><span class="hljs-comment"># 0: disable all list compression	禁用所有列表压缩</span><br><span class="hljs-comment"># 1: depth 1 means &quot;don&#x27;t start compressing until after 1 node into the list,</span><br><span class="hljs-comment">#	深度 1 表示“在列表中的 1 个节点之后才开始压缩，</span><br><span class="hljs-comment">#    going from either the head or tail&quot;	从头部或尾部</span><br><span class="hljs-comment">#    So: [head]-&gt;node-&gt;node-&gt;...-&gt;node-&gt;[tail]</span><br><span class="hljs-comment">#    [head], [tail] will always be uncompressed; inner nodes will compress.</span><br><span class="hljs-comment"># 	[头部]，[尾部]将始终未压缩；内部节点将压缩。</span><br><span class="hljs-comment"># 2: [head]-&gt;[next]-&gt;node-&gt;node-&gt;...-&gt;node-&gt;[prev]-&gt;[tail]</span><br><span class="hljs-comment">#    2 here means: don&#x27;t compress head or head-&gt;next or tail-&gt;prev or tail,</span><br><span class="hljs-comment">#    but compress all nodes between them.</span><br><span class="hljs-comment">#	2 这里的意思是：不要压缩头部或头部-&gt;下一个或尾部-&gt;上一个或尾部，但是压缩它们之间的所有节点。</span><br><span class="hljs-comment"># 3: [head]-&gt;[next]-&gt;[next]-&gt;node-&gt;node-&gt;...-&gt;node-&gt;[prev]-&gt;[prev]-&gt;[tail]</span><br><span class="hljs-comment"># etc.</span><br>list-compress-depth 0	<span class="hljs-comment"># 压缩深度</span><br><br><span class="hljs-comment"># Sets have a special encoding in just one case: when a set is composed</span><br><span class="hljs-comment"># of just strings that happen to be integers in radix 10 in the range</span><br><span class="hljs-comment"># of 64 bit signed integers.</span><br><span class="hljs-comment"># 在仅一种情况下，集合具有特殊的编码：当集合仅由字符串组成，这些字符串恰好是基数为10的整数，范围为64位有符号整数。</span><br><span class="hljs-comment"># The following configuration setting sets the limit in the size of the</span><br><span class="hljs-comment"># set in order to use this special memory saving encoding.</span><br><span class="hljs-comment"># 以下配置设置设置了大小限制，以便使用此特殊的内存节省编码。</span><br>set-max-intset-entries 512<br><br><span class="hljs-comment"># Similarly to hashes and lists, sorted sets are also specially encoded in</span><br><span class="hljs-comment"># order to save a lot of space. This encoding is only used when the length and</span><br><span class="hljs-comment"># elements of a sorted set are below the following limits:</span><br><span class="hljs-comment"># 与哈希表和列表类似，对有序集也进行了特殊编码，以节省大量空间。仅当有序集的长度和元素低于以下限制时，才使用此编码：</span><br>zset-max-ziplist-entries 128<br>zset-max-ziplist-value 64<br><br><span class="hljs-comment"># HyperLogLog sparse representation bytes limit. The limit includes the</span><br><span class="hljs-comment"># 16 bytes header. When an HyperLogLog using the sparse representation crosses</span><br><span class="hljs-comment"># this limit, it is converted into the dense representation.</span><br><span class="hljs-comment"># HyperLogLog 稀疏表示形式的字节数限制。限制包括16个字节的标头。当使用稀疏表示的 HyperLogLog 超过此限制时，它将转换为密集表示。</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># A value greater than 16000 is totally useless, since at that point the</span><br><span class="hljs-comment"># dense representation is more memory efficient.</span><br><span class="hljs-comment"># 大于 16000 的值是完全没有用的，因为在那一点上，密集表示的存储效率更高。</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># The suggested value is ~ 3000 in order to have the benefits of</span><br><span class="hljs-comment"># the space efficient encoding without slowing down too much PFADD,</span><br><span class="hljs-comment"># which is O(N) with the sparse encoding. The value can be raised to</span><br><span class="hljs-comment"># ~ 10000 when CPU is not a concern, but space is, and the data set is</span><br><span class="hljs-comment"># composed of many HyperLogLogs with cardinality in the 0 - 15000 range.</span><br><span class="hljs-comment"># 建议值约为 3000，以便在不降低过多 PFADD 的情况下获得节省空间编码的好处，而 PFADD 的稀疏编码为O（N）。 当不关心 CPU 但空间很大时，该值可以提高到 10000，并且数据集由基数在 0-15000 范围内的许多 HyperLogLog 组成。</span><br>hll-sparse-max-bytes 3000<br><br><span class="hljs-comment"># Streams macro node max size / items. The stream data structure is a radix</span><br><span class="hljs-comment"># tree of big nodes that encode multiple items inside. Using this configuration</span><br><span class="hljs-comment"># it is possible to configure how big a single node can be in bytes, and the</span><br><span class="hljs-comment"># maximum number of items it may contain before switching to a new node when</span><br><span class="hljs-comment"># appending new stream entries. If any of the following settings are set to</span><br><span class="hljs-comment"># zero, the limit is ignored, so for instance it is possible to set just a</span><br><span class="hljs-comment"># max entires limit by setting max-bytes to 0 and max-entries to the desired</span><br><span class="hljs-comment"># value.</span><br><span class="hljs-comment"># 流宏节点最大大小/项目。流数据结构是一个大节点的基数树，它对内部的多个项目进行编码。使用此配置，可以配置单个节点的大小（以字节为单位），以及在添加新的流条目时切换到新节点之前它可能包含的最大项目数。如果以下任何设置被设置为零，则该限制将被忽略，例如，可以通过将 max-bytes 设置为 0 并将 max-entries 设置为所需值来仅设置最大整体限制。</span><br>stream-node-max-bytes 4096<br>stream-node-max-entries 100<br><br><span class="hljs-comment"># Active rehashing uses 1 millisecond every 100 milliseconds of CPU time in</span><br><span class="hljs-comment"># order to help rehashing the main Redis hash table (the one mapping top-level</span><br><span class="hljs-comment"># keys to values). The hash table implementation Redis uses (see dict.c)</span><br><span class="hljs-comment"># performs a lazy rehashing: the more operation you run into a hash table</span><br><span class="hljs-comment"># that is rehashing, the more rehashing &quot;steps&quot; are performed, so if the</span><br><span class="hljs-comment"># server is idle the rehashing is never complete and some more memory is used</span><br><span class="hljs-comment"># by the hash table.</span><br><span class="hljs-comment"># 活动重新哈希处理每 100 毫秒 CPU 时间使用 1 毫秒，以帮助重新哈希主 Redis 哈希表（将顶级键映射到值的一个哈希表）。Redis 使用的哈希表实现（请参见dict.c）执行一次懒惰的重新哈希处理：您在要进行哈希处理的哈希表中运行的操作越多，执行的哈希处理“步骤”就越多，因此，如果服务器空闲，则哈希处理将永远不会完成 散列表使用更多的内存。</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># The default is to use this millisecond 10 times every second in order to</span><br><span class="hljs-comment"># actively rehash the main dictionaries, freeing memory when possible.</span><br><span class="hljs-comment"># 默认值是每秒使用 10 毫秒的毫秒数来主动重新哈希主字典，并在可能的情况下释放内存。</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># If unsure:</span><br><span class="hljs-comment"># use &quot;activerehashing no&quot; if you have hard latency requirements and it is</span><br><span class="hljs-comment"># not a good thing in your environment that Redis can reply from time to time</span><br><span class="hljs-comment"># to queries with 2 milliseconds delay.</span><br><span class="hljs-comment"># 如果不确定：如果您有严格的延迟要求，请使用“ activerehashing no”，并且在您的环境中，Redis 可以不时地以 2 毫秒的延迟答复查询不是一件好事。</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># use &quot;activerehashing yes&quot; if you don&#x27;t have such hard requirements but</span><br><span class="hljs-comment"># want to free memory asap when possible.</span><br><span class="hljs-comment"># 如果您没有如此严格的要求，但希望在可能的情况下尽快释放内存，请使用“ activerehashing yes”。</span><br>activerehashing yes<br><br><span class="hljs-comment"># The client output buffer limits can be used to force disconnection of clients</span><br><span class="hljs-comment"># that are not reading data from the server fast enough for some reason (a</span><br><span class="hljs-comment"># common reason is that a Pub/Sub client can&#x27;t consume messages as fast as the</span><br><span class="hljs-comment"># publisher can produce them).</span><br><span class="hljs-comment"># 客户端输出缓冲区限制可用于强制出于某些原因而无法以足够快的速度从服务器读取数据的客户端断开连接（常见原因是Pub / Sub客户端无法像发布者产生消息那样快地消耗消息）。</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># The limit can be set differently for the three different classes of clients:</span><br><span class="hljs-comment"># 可以为三种不同类别的客户端设置不同的限制：</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># normal -&gt; normal clients including MONITOR clients	普通客户端，包括 MONITOR 客户端</span><br><span class="hljs-comment"># replica  -&gt; replica clients	 副本客户端</span><br><span class="hljs-comment"># pubsub -&gt; clients subscribed to at least one pubsub channel or pattern</span><br><span class="hljs-comment">#			客户端至少订阅了一个 pubsub 频道或模式</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># The syntax of every client-output-buffer-limit directive is the following:</span><br><span class="hljs-comment">#  每个 client-output-buffer-limit 指令的语法如下：</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># client-output-buffer-limit &lt;class&gt; &lt;hard limit&gt; &lt;soft limit&gt; &lt;soft seconds&gt;</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># A client is immediately disconnected once the hard limit is reached, or if</span><br><span class="hljs-comment"># the soft limit is reached and remains reached for the specified number of</span><br><span class="hljs-comment"># seconds (continuously).</span><br><span class="hljs-comment">#  一旦达到硬限制，或者达到软限制并在指定的秒数内（连续）保持达到此限制，客户端将立即断开连接。</span><br><span class="hljs-comment"># So for instance if the hard limit is 32 megabytes and the soft limit is</span><br><span class="hljs-comment"># 16 megabytes / 10 seconds, the client will get disconnected immediately</span><br><span class="hljs-comment"># if the size of the output buffers reach 32 megabytes, but will also get</span><br><span class="hljs-comment"># disconnected if the client reaches 16 megabytes and continuously overcomes</span><br><span class="hljs-comment"># the limit for 10 seconds.</span><br><span class="hljs-comment"># 因此，例如，如果硬限制为 32 兆字节，软限制为 16 兆字节/ 10秒，则如果输出缓冲区的大小达到 32 兆字节，客户端将立即断开连接，但如果客户端达到 16 兆字节，则也会断开连接。持续超过限制 10 秒钟。</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># By default normal clients are not limited because they don&#x27;t receive data</span><br><span class="hljs-comment"># without asking (in a push way), but just after a request, so only</span><br><span class="hljs-comment"># asynchronous clients may create a scenario where data is requested faster</span><br><span class="hljs-comment"># than it can read.</span><br><span class="hljs-comment"># 默认情况下，普通客户端不受限制，因为它们不会在不询问的情况下（以推送方式）接收数据，而是在请求之后才接收数据，因此，只有异步客户端才能创建这样的场景：请求数据的速度比读取数据的速度快。</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># Instead there is a default limit for pubsub and replica clients, since</span><br><span class="hljs-comment"># subscribers and replicas receive data in a push fashion.</span><br><span class="hljs-comment"># 相反，由于订阅者和副本以推送方式接收数据，因此对 pubsub 和副本客户端没有默认限制。</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># Both the hard or the soft limit can be disabled by setting them to zero.</span><br><span class="hljs-comment">#  硬限制或软限制都可以通过将其设置为零来禁用。</span><br>client-output-buffer-limit normal 0 0 0<br>client-output-buffer-limit replica 256mb 64mb 60<br>client-output-buffer-limit pubsub 32mb 8mb 60<br><br><span class="hljs-comment"># Client query buffers accumulate new commands. They are limited to a fixed</span><br><span class="hljs-comment"># amount by default in order to avoid that a protocol desynchronization (for</span><br><span class="hljs-comment"># instance due to a bug in the client) will lead to unbound memory usage in</span><br><span class="hljs-comment"># the query buffer. However you can configure it here if you have very special</span><br><span class="hljs-comment"># needs, such us huge multi/exec requests or alike.</span><br><span class="hljs-comment"># 客户端查询缓冲区会累积新命令。默认情况下，它们被限制为固定数量，以避免协议不同步（例如由于客户端错误）导致查询缓冲区中的未绑定内存使用。但是，如果您有非常特殊的需求，例如巨大的 multi / exec请求等，则可以在此处进行配置。</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># client-query-buffer-limit 1gb</span><br><br><span class="hljs-comment"># In the Redis protocol, bulk requests, that are, elements representing single</span><br><span class="hljs-comment"># strings, are normally limited ot 512 mb. However you can change this limit</span><br><span class="hljs-comment"># here.</span><br><span class="hljs-comment"># 在Redis协议中，批量请求（即表示单个字符串的元素）通常限制为512 mb。 但是，您可以在此处更改此限制。</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># proto-max-bulk-len 512mb</span><br><br><span class="hljs-comment"># Redis calls an internal function to perform many background tasks, like</span><br><span class="hljs-comment"># closing connections of clients in timeout, purging expired keys that are</span><br><span class="hljs-comment"># never requested, and so forth.</span><br><span class="hljs-comment"># Redis 调用一个内部函数来执行许多后台任务，例如超时关闭客户端连接，清除从未请求的过期 key 等。</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># Not all tasks are performed with the same frequency, but Redis checks for</span><br><span class="hljs-comment"># tasks to perform according to the specified &quot;hz&quot; value.</span><br><span class="hljs-comment"># 并非所有任务都以相同的频率执行，但是Redis根据指定的“ hz”值检查要执行的任务。</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># By default &quot;hz&quot; is set to 10. Raising the value will use more CPU when</span><br><span class="hljs-comment"># Redis is idle, but at the same time will make Redis more responsive when</span><br><span class="hljs-comment"># there are many keys expiring at the same time, and timeouts may be</span><br><span class="hljs-comment"># handled with more precision.</span><br><span class="hljs-comment">#   默认情况下，“ hz”设置为10。提高该值将在 Redis 空闲时使用更多的 CPU，但是同时当有多个键同时到期时，它将使 Redis 的响应速度更快，并且可以使超时处理更精确。</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># The range is between 1 and 500, however a value over 100 is usually not</span><br><span class="hljs-comment"># a good idea. Most users should use the default of 10 and raise this up to</span><br><span class="hljs-comment"># 100 only in environments where very low latency is required.</span><br><span class="hljs-comment">#  范围在1到500之间，但是通常不建议超过100。 大多数用户应该使用默认值10，并且仅在要求非常低延迟的环境中才将其提高到100。</span><br>hz 10<br><br><span class="hljs-comment"># Normally it is useful to have an HZ value which is proportional to the</span><br><span class="hljs-comment"># number of clients connected. This is useful in order, for instance, to</span><br><span class="hljs-comment"># avoid too many clients are processed for each background task invocation</span><br><span class="hljs-comment"># in order to avoid latency spikes.</span><br><span class="hljs-comment"># 通常，具有与连接的客户端数量成比例的 HZ 值很有用。例如，这有助于避免每次后台任务调用处理过多的客户端，从而避免延迟尖峰。</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># Since the default HZ value by default is conservatively set to 10, Redis</span><br><span class="hljs-comment"># offers, and enables by default, the ability to use an adaptive HZ value</span><br><span class="hljs-comment"># which will temporary raise when there are many connected clients.</span><br><span class="hljs-comment"># 由于默认的默认 HZ 值保守地设置为 10，因此 Redis 提供并默认启用了使用自适应 HZ 值的能力，当有许多连接的客户端时，该值会暂时升高。</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># When dynamic HZ is enabled, the actual configured HZ will be used as</span><br><span class="hljs-comment"># as a baseline, but multiples of the configured HZ value will be actually</span><br><span class="hljs-comment"># used as needed once more clients are connected. In this way an idle</span><br><span class="hljs-comment"># instance will use very little CPU time while a busy instance will be</span><br><span class="hljs-comment"># more responsive.</span><br><span class="hljs-comment"># 启用动态 HZ 后，实际配置的 HZ 将用作基准，但是一旦连接了更多客户端，实际将使用配置的 HZ 值的倍数。 这样，空闲实例将占用很少的 CPU 时间，而忙碌的实例将具有更高的响应速度。</span><br>dynamic-hz yes<br><br><span class="hljs-comment"># When a child rewrites the AOF file, if the following option is enabled</span><br><span class="hljs-comment"># the file will be fsync-ed every 32 MB of data generated. This is useful</span><br><span class="hljs-comment"># in order to commit the file to the disk more incrementally and avoid</span><br><span class="hljs-comment"># big latency spikes.</span><br><span class="hljs-comment"># 当重写 AOF 文件时，如果启用了以下选项，则每生成 32MB的 数据，文件就会进行同步处理。为了将文件更多地提交到磁盘并避免大的延迟尖峰，这很有用。</span><br>aof-rewrite-incremental-fsync yes<br><br><span class="hljs-comment"># When redis saves RDB file, if the following option is enabled</span><br><span class="hljs-comment"># the file will be fsync-ed every 32 MB of data generated. This is useful</span><br><span class="hljs-comment"># in order to commit the file to the disk more incrementally and avoid</span><br><span class="hljs-comment"># big latency spikes.</span><br><span class="hljs-comment"># 当 redis 保存 RDB 文件时，如果启用以下选项，则每生成 32MB 数据将对文件进行 fsync 处理。 为了将文件更多地提交到磁盘并避免大的延迟尖峰，这很有用。</span><br>rdb-save-incremental-fsync yes<br><br><span class="hljs-comment"># Redis LFU eviction (see maxmemory setting) can be tuned. However it is a good</span><br><span class="hljs-comment"># idea to start with the default settings and only change them after investigating</span><br><span class="hljs-comment"># how to improve the performances and how the keys LFU change over time, which</span><br><span class="hljs-comment"># is possible to inspect via the OBJECT FREQ command.</span><br><span class="hljs-comment"># 可以调整 Redis LFU 逐出（请参阅maxmemory设置）。 但是，最好从默认设置开始，仅在研究了如何提高性能以及LFU 键随时间的变化后才进行更改，可以通过 OBJECT FREQ 命令进行检查。</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># There are two tunable parameters in the Redis LFU implementation: the</span><br><span class="hljs-comment"># counter logarithm factor and the counter decay time. It is important to</span><br><span class="hljs-comment"># understand what the two parameters mean before changing them.</span><br><span class="hljs-comment"># Redis LFU 实现中有两个可调参数：计数器对数因子和计数器衰减时间。 在更改这两个参数之前，请务必先了解这两个参数的含义。</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># The LFU counter is just 8 bits per key, it&#x27;s maximum value is 255, so Redis</span><br><span class="hljs-comment"># uses a probabilistic increment with logarithmic behavior. Given the value</span><br><span class="hljs-comment"># of the old counter, when a key is accessed, the counter is incremented in</span><br><span class="hljs-comment"># this way:</span><br><span class="hljs-comment"># LFU 计数器每个 key 只有 8 位，最大值是 255，因此 Redis 使用具有对数行为的概率增量。 给定旧计数器的值，当访问一个键时，计数器以这种方式递增：</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># 1. A random number R between 0 and 1 is extracted.</span><br><span class="hljs-comment"># 2. A probability P is calculated as 1/(old_value*lfu_log_factor+1).</span><br><span class="hljs-comment"># 3. The counter is incremented only if R &lt; P.</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># The default lfu-log-factor is 10. This is a table of how the frequency</span><br><span class="hljs-comment"># counter changes with a different number of accesses with different</span><br><span class="hljs-comment"># logarithmic factors:</span><br><span class="hljs-comment"># 默认的 lfu-log-factor 是 10。这是一个表格，该表格显示了频率计数器如何随着具有不同对数因子的不同访问次数而变化：</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># +--------+------------+------------+------------+------------+------------+</span><br><span class="hljs-comment"># | factor | 100 hits   | 1000 hits  | 100K hits  | 1M hits    | 10M hits   |</span><br><span class="hljs-comment"># +--------+------------+------------+------------+------------+------------+</span><br><span class="hljs-comment"># | 0      | 104        | 255        | 255        | 255        | 255        |</span><br><span class="hljs-comment"># +--------+------------+------------+------------+------------+------------+</span><br><span class="hljs-comment"># | 1      | 18         | 49         | 255        | 255        | 255        |</span><br><span class="hljs-comment"># +--------+------------+------------+------------+------------+------------+</span><br><span class="hljs-comment"># | 10     | 10         | 18         | 142        | 255        | 255        |</span><br><span class="hljs-comment"># +--------+------------+------------+------------+------------+------------+</span><br><span class="hljs-comment"># | 100    | 8          | 11         | 49         | 143        | 255        |</span><br><span class="hljs-comment"># +--------+------------+------------+------------+------------+------------+</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># <span class="hljs-doctag">NOTE:</span> The above table was obtained by running the following commands:</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment">#   redis-benchmark -n 1000000 incr foo</span><br><span class="hljs-comment">#   redis-cli object freq foo</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># NOTE 2: The counter initial value is 5 in order to give new objects a chance</span><br><span class="hljs-comment"># to accumulate hits.</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># The counter decay time is the time, in minutes, that must elapse in order</span><br><span class="hljs-comment"># for the key counter to be divided by two (or decremented if it has a value</span><br><span class="hljs-comment"># less &lt;= 10).</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># The default value for the lfu-decay-time is 1. A Special value of 0 means to</span><br><span class="hljs-comment"># decay the counter every time it happens to be scanned.</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># lfu-log-factor 10</span><br><span class="hljs-comment"># lfu-decay-time 1</span><br><br><span class="hljs-comment">########################### ACTIVE DEFRAGMENTATION 主动碎片整理 #######################</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># WARNING THIS FEATURE IS EXPERIMENTAL. However it was stress tested</span><br><span class="hljs-comment"># even in production and manually tested by multiple engineers for some</span><br><span class="hljs-comment"># time.</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># What is active defragmentation?</span><br><span class="hljs-comment"># -------------------------------</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># Active (online) defragmentation allows a Redis server to compact the</span><br><span class="hljs-comment"># spaces left between small allocations and deallocations of data in memory,</span><br><span class="hljs-comment"># thus allowing to reclaim back memory.</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># Fragmentation is a natural process that happens with every allocator (but</span><br><span class="hljs-comment"># less so with Jemalloc, fortunately) and certain workloads. Normally a server</span><br><span class="hljs-comment"># restart is needed in order to lower the fragmentation, or at least to flush</span><br><span class="hljs-comment"># away all the data and create it again. However thanks to this feature</span><br><span class="hljs-comment"># implemented by Oran Agra for Redis 4.0 this process can happen at runtime</span><br><span class="hljs-comment"># in an &quot;hot&quot; way, while the server is running.</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># Basically when the fragmentation is over a certain level (see the</span><br><span class="hljs-comment"># configuration options below) Redis will start to create new copies of the</span><br><span class="hljs-comment"># values in contiguous memory regions by exploiting certain specific Jemalloc</span><br><span class="hljs-comment"># features (in order to understand if an allocation is causing fragmentation</span><br><span class="hljs-comment"># and to allocate it in a better place), and at the same time, will release the</span><br><span class="hljs-comment"># old copies of the data. This process, repeated incrementally for all the keys</span><br><span class="hljs-comment"># will cause the fragmentation to drop back to normal values.</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># Important things to understand:</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># 1. This feature is disabled by default, and only works if you compiled Redis</span><br><span class="hljs-comment">#    to use the copy of Jemalloc we ship with the source code of Redis.</span><br><span class="hljs-comment">#    This is the default with Linux builds.</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># 2. You never need to enable this feature if you don&#x27;t have fragmentation</span><br><span class="hljs-comment">#    issues.</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># 3. Once you experience fragmentation, you can enable this feature when</span><br><span class="hljs-comment">#    needed with the command &quot;CONFIG SET activedefrag yes&quot;.</span><br><span class="hljs-comment">#</span><br><span class="hljs-comment"># The configuration parameters are able to fine tune the behavior of the</span><br><span class="hljs-comment"># defragmentation process. If you are not sure about what they mean it is</span><br><span class="hljs-comment"># a good idea to leave the defaults untouched.</span><br><br><span class="hljs-comment"># Enabled active defragmentation	启用主动碎片整理</span><br><span class="hljs-comment"># activedefrag yes</span><br><br><span class="hljs-comment"># Minimum amount of fragmentation waste to start active defrag</span><br><span class="hljs-comment"># 启动主动碎片整理所需的碎片碎片最少</span><br><span class="hljs-comment"># active-defrag-ignore-bytes 100mb</span><br><br><span class="hljs-comment"># Minimum percentage of fragmentation to start active defrag</span><br><span class="hljs-comment"># 启动主动碎片整理的最小碎片百分比</span><br><span class="hljs-comment"># active-defrag-threshold-lower 10</span><br><br><span class="hljs-comment"># Maximum percentage of fragmentation at which we use maximum effort</span><br><span class="hljs-comment"># 我们在最大程度地使用碎片的最大百分比</span><br><span class="hljs-comment"># active-defrag-threshold-upper 100</span><br><br><span class="hljs-comment"># Minimal effort for defrag in CPU percentage	减少CPU碎片整理的工作量</span><br><span class="hljs-comment"># active-defrag-cycle-min 5</span><br><br><span class="hljs-comment"># Maximal effort for defrag in CPU percentage	尽最大努力整理CPU百分比</span><br><span class="hljs-comment"># active-defrag-cycle-max 75</span><br><br><span class="hljs-comment"># Maximum number of set/hash/zset/list fields that will be processed from</span><br><span class="hljs-comment"># the main dictionary scan</span><br><span class="hljs-comment"># 主字典扫描将处理的set / hash / zset / list字段的最大数量</span><br><span class="hljs-comment"># active-defrag-max-scan-fields 1000</span><br><br></code></pre></td></tr></table></figure>


            </div>
            <hr>
            <div>
              <div class="post-metas mb-3">
                
                  <div class="post-meta mr-3">
                    <i class="iconfont icon-category"></i>
                    
                      <a class="hover-with-bg" href="/categories/Redis/">Redis</a>
                    
                  </div>
                
                
                  <div class="post-meta">
                    <i class="iconfont icon-tags"></i>
                    
                      <a class="hover-with-bg" href="/tags/Redis/">Redis</a>
                    
                  </div>
                
              </div>
              
                <p class="note note-warning">
                  
                    本博客所有文章除特别声明外，均采用 <a target="_blank" href="https://creativecommons.org/licenses/by-sa/4.0/deed.zh" rel="nofollow noopener noopener">CC BY-SA 4.0 协议</a> ，转载请注明出处！
                  
                </p>
              
              
                <div class="post-prevnext">
                  <article class="post-prev col-6">
                    
                    
                      <a href="/2020/05/13/redis/Redis%E4%B8%BB%E4%BB%8E%E6%9C%8D%E5%8A%A1%E5%99%A8%E5%AE%9E%E6%88%98/">
                        <i class="iconfont icon-arrowleft"></i>
                        <span class="hidden-mobile">Redis主从服务器实战</span>
                        <span class="visible-mobile">上一篇</span>
                      </a>
                    
                  </article>
                  <article class="post-next col-6">
                    
                    
                      <a href="/2020/05/09/LeetCode/%E6%AF%8F%E6%97%A5%E4%B8%80%E9%A2%98%E2%80%94%E2%80%94%E6%9C%89%E6%95%88%E7%9A%84%E6%8B%AC%E5%8F%B7/">
                        <span class="hidden-mobile">每日一题——整数反转</span>
                        <span class="visible-mobile">下一篇</span>
                        <i class="iconfont icon-arrowright"></i>
                      </a>
                    
                  </article>
                </div>
              
            </div>

            
          </article>
        </div>
      </div>
    </div>
    
      <div class="d-none d-lg-block col-lg-2 toc-container" id="toc-ctn">
        <div id="toc">
  <p class="toc-header"><i class="iconfont icon-list"></i>&nbsp;目录</p>
  <div class="toc-body" id="toc-body"></div>
</div>

      </div>
    
  </div>
</div>

<!-- Custom -->


    

    
      <a id="scroll-top-button" aria-label="TOP" href="#" role="button">
        <i class="iconfont icon-arrowup" aria-hidden="true"></i>
      </a>
    

    
      <div class="modal fade" id="modalSearch" tabindex="-1" role="dialog" aria-labelledby="ModalLabel"
     aria-hidden="true">
  <div class="modal-dialog modal-dialog-scrollable modal-lg" role="document">
    <div class="modal-content">
      <div class="modal-header text-center">
        <h4 class="modal-title w-100 font-weight-bold">搜索</h4>
        <button type="button" id="local-search-close" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body mx-3">
        <div class="md-form mb-5">
          <input type="text" id="local-search-input" class="form-control validate">
          <label data-error="x" data-success="v"
                 for="local-search-input">关键词</label>
        </div>
        <div class="list-group" id="local-search-result"></div>
      </div>
    </div>
  </div>
</div>
    

    
  </main>

  <footer class="text-center mt-5 py-3">
  <div class="footer-content">
     <a href="https://hexo.io" target="_blank" rel="nofollow noopener"><span>Hexo</span></a> <i class="iconfont icon-love"></i> <a href="https://github.com/fluid-dev/hexo-theme-fluid" target="_blank" rel="nofollow noopener"><span>Fluid</span></a> 
  </div>
  

  

  
</footer>


  <!-- SCRIPTS -->
  
  <script  src="https://cdn.jsdelivr.net/npm/nprogress@0/nprogress.min.js" ></script>
  <link  rel="stylesheet" href="https://cdn.jsdelivr.net/npm/nprogress@0/nprogress.min.css" />

  <script>
    NProgress.configure({"showSpinner":false,"trickleSpeed":100})
    NProgress.start()
    window.addEventListener('load', function() {
      NProgress.done();
    })
  </script>


<script  src="https://cdn.jsdelivr.net/npm/jquery@3/dist/jquery.min.js" ></script>
<script  src="https://cdn.jsdelivr.net/npm/bootstrap@4/dist/js/bootstrap.min.js" ></script>
<script  src="/js/events.js" ></script>
<script  src="/js/plugins.js" ></script>

<!-- Plugins -->


  <script  src="/js/local-search.js" ></script>



  
    <script  src="/js/img-lazyload.js" ></script>
  



  



  
    <script  src="https://cdn.jsdelivr.net/npm/tocbot@4/dist/tocbot.min.js" ></script>
  
  
    <script  src="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@3/dist/jquery.fancybox.min.js" ></script>
  
  
    <script  src="https://cdn.jsdelivr.net/npm/anchor-js@4/anchor.min.js" ></script>
  
  
    <script defer src="https://cdn.jsdelivr.net/npm/clipboard@2/dist/clipboard.min.js" ></script>
  






  <script  src="https://cdn.jsdelivr.net/npm/typed.js@2/lib/typed.min.js" ></script>
  <script>
    (function (window, document) {
      var typing = Fluid.plugins.typing;
      var title = document.getElementById('subtitle').title;
      
        typing(title);
      
    })(window, document);
  </script>















<!-- 主题的启动项 保持在最底部 -->
<script  src="/js/boot.js" ></script>


</body>
</html>
